提交 a2ada859 编写于 作者: A Alex Dima

Merge remote-tracking branch 'origin/master' into ben/lazy-onigasm

......@@ -57,6 +57,7 @@ const indentationFilter = [
'!test/assert.js',
// except specific folders
'!test/automation/out/**',
'!test/smoke/out/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
......@@ -152,6 +153,7 @@ const tslintCoreFilter = [
'src/**/*.ts',
'test/**/*.ts',
'!extensions/**/*.ts',
'!test/automation/**',
'!test/smoke/**',
...tslintBaseFilter
];
......@@ -160,6 +162,7 @@ const tslintExtensionsFilter = [
'extensions/**/*.ts',
'!src/**/*.ts',
'!test/**/*.ts',
'test/automation/**/*.ts',
...tslintBaseFilter
];
......
......@@ -42,6 +42,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@EXEC@@', `/usr/share/${product.applicationName}/${product.applicationName}`))
.pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
......@@ -134,6 +135,7 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@EXEC@@', `/usr/share/${product.applicationName}/${product.applicationName}`))
.pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
......@@ -203,21 +205,25 @@ function prepareSnapPackage(arch) {
const destination = getSnapBuildPath(arch);
return function () {
// A desktop file that is placed in snap/gui will be placed into meta/gui verbatim.
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
.pipe(rename(`snap/gui/${product.applicationName}.desktop`));
// A desktop file that is placed in snap/gui will be placed into meta/gui verbatim.
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
.pipe(rename(`usr/share/applications/${product.applicationName}-url-handler.desktop`));
.pipe(rename(`snap/gui/${product.applicationName}-url-handler.desktop`));
const desktops = es.merge(desktop, desktopUrlHandler)
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
.pipe(replace('@@EXEC@@', product.applicationName))
.pipe(replace('@@ICON@@', `\${SNAP}/meta/gui/${product.linuxIconName}.png`))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
// An icon that is placed in snap/gui will be placed into meta/gui verbatim.
const icon = gulp.src('resources/linux/code.png', { base: '.' })
.pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
.pipe(rename(`snap/gui/${product.linuxIconName}.png`));
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
......
......@@ -35,7 +35,7 @@ const vscodeWebResources = [
// Workbench
'out-build/vs/{base,platform,editor,workbench}/**/*.{svg,png}',
'out-build/vs/code/browser/workbench/workbench.html',
'out-build/vs/code/browser/workbench/*.html',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/**/markdown.css',
......
......@@ -69,11 +69,12 @@ function createCompile(src, build, emitError) {
function compileTask(src, out, build) {
return function () {
const compile = createCompile(src, build, true);
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
let generator = new MonacoGenerator(false);
if (src === 'src') {
generator.execute();
}
return compile.tsProjectSrc()
return srcPipe
.pipe(generator.stream)
.pipe(compile())
.pipe(gulp.dest(out));
......@@ -83,7 +84,7 @@ exports.compileTask = compileTask;
function watchTask(out, build) {
return function () {
const compile = createCompile('src', build);
const src = compile.tsProjectSrc();
const src = gulp.src('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
let generator = new MonacoGenerator(true);
generator.execute();
......
......@@ -82,13 +82,13 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
return function () {
const compile = createCompile(src, build, true);
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
let generator = new MonacoGenerator(false);
if (src === 'src') {
generator.execute();
}
return compile.tsProjectSrc()
return srcPipe
.pipe(generator.stream)
.pipe(compile())
.pipe(gulp.dest(out));
......@@ -100,7 +100,7 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
return function () {
const compile = createCompile('src', build);
const src = compile.tsProjectSrc();
const src = gulp.src('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
let generator = new MonacoGenerator(true);
......
......@@ -121,7 +121,7 @@ function loadSourcemaps() {
return;
}
if (!f.contents) {
cb(new Error('empty file'));
cb(undefined, f);
return;
}
const contents = f.contents.toString('utf8');
......
......@@ -165,7 +165,7 @@ export function loadSourcemaps(): NodeJS.ReadWriteStream {
}
if (!f.contents) {
cb(new Error('empty file'));
cb(undefined, f);
return;
}
......
......@@ -5,17 +5,6 @@
const es = require('event-stream');
/** Ugly hack for gulp-tsb */
function handleDeletions() {
return es.mapSync(f => {
if (/\.ts$/.test(f.relative) && !f.contents) {
f.contents = Buffer.from('');
f.stat = { mtime: new Date() };
}
return f;
});
}
let watch = undefined;
......@@ -24,6 +13,5 @@ if (!watch) {
}
module.exports = function () {
return watch.apply(null, arguments)
.pipe(handleDeletions());
return watch.apply(null, arguments);
};
......@@ -70,6 +70,7 @@ runtime "${runtime}"`;
}
yarnInstall(`build`); // node modules required for build
yarnInstall('test/automation'); // node modules required for smoketest
yarnInstall('test/smoke'); // node modules required for smoketest
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
......
......@@ -2433,9 +2433,9 @@ vsce@1.48.0:
yazl "^2.2.2"
vscode-ripgrep@^1.5.6:
version "1.5.6"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.6.tgz#93bf5c99ca5f8248950a305e224f6ca153c30af4"
integrity sha512-WRIM9XpUj6dsfdAmuI3ANbmT1ysPUVsYy/2uCLDHJa9kbiB4T7uGvFnnc0Rgx2qQnyRAwL7PeWaFgUljPPxf2g==
version "1.5.7"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.7.tgz#acb6b548af488a4bca5d0f1bb5faf761343289ce"
integrity sha512-/Vsz/+k8kTvui0q3O74pif9FK0nKopgFTiGNVvxicZANxtSA8J8gUE9GQ/4dpi7D/2yI/YVORszwVskFbz46hQ==
vscode-telemetry-extractor@^1.5.4:
version "1.5.4"
......
......@@ -10,7 +10,7 @@
"main": "./out/htmlServerMain",
"dependencies": {
"vscode-css-languageservice": "^4.0.3-next.6",
"vscode-html-languageservice": "^3.0.4-next.2",
"vscode-html-languageservice": "^3.0.4-next.3",
"vscode-languageserver": "^5.3.0-next.8",
"vscode-languageserver-types": "3.15.0-next.2",
"vscode-nls": "^4.1.1",
......
......@@ -238,10 +238,10 @@ vscode-css-languageservice@^4.0.3-next.6:
vscode-nls "^4.1.1"
vscode-uri "^2.0.3"
vscode-html-languageservice@^3.0.4-next.2:
version "3.0.4-next.2"
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.4-next.2.tgz#afdbe2781daa0a72613afac77068593925bd2e07"
integrity sha512-tlyiflBm/k/PoTwGzg4LL0cwq6wS7mnKxDVYSlY2Iw21dONWINaS0MynYCn6Zs4PzIpgueCSMuTBQTey4d+BBQ==
vscode-html-languageservice@^3.0.4-next.3:
version "3.0.4-next.3"
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.4-next.3.tgz#7a0fc33aae846165b157acbb8b133cc3fcf2ca0d"
integrity sha512-PGIcKFxqsvVMv51QWreuQx9LhN43Vzhgl8RYI8CcWThjl+J8uUKImjwAWq9zndOiiRUPF2Zk7zME/dMIis1hOw==
dependencies:
vscode-languageserver-types "^3.15.0-next.2"
vscode-nls "^4.1.1"
......
......@@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "3.6.2"
"typescript": "3.6.3-insiders.20190909"
},
"scripts": {
"postinstall": "node ./postinstall"
......
......@@ -2,7 +2,7 @@
# yarn lockfile v1
typescript@3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54"
integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==
typescript@3.6.3-insiders.20190909:
version "3.6.3-insiders.20190909"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3-insiders.20190909.tgz#65b6b2d809288311a970819849e1964ac73e1fda"
integrity sha512-Lr7ONd8Y05EhrI+zKoI5tgvO5dhuRDrK5pyOLG33DeMln8zb8w7Yc8AoIEyqvxB5Btj9F7zBmXBXJdTI3SuX0Q==
{
"name": "code-oss-dev",
"version": "1.39.0",
"distro": "8516b3c6e37976c7f4a183ec1196a939f0ff11bf",
"distro": "11a8f56d5044ab27417b2d81f5d8f65c5d55f48c",
"author": {
"name": "Microsoft Corporation"
},
......@@ -49,7 +49,7 @@
"vscode-chokidar": "2.1.7",
"vscode-minimist": "^1.2.1",
"vscode-proxy-agent": "0.4.0",
"vscode-ripgrep": "^1.5.6",
"vscode-ripgrep": "^1.5.7",
"vscode-sqlite3": "4.0.8",
"vscode-textmate": "^4.2.2",
"xterm": "3.15.0-beta108",
......
......@@ -19,7 +19,7 @@
"vscode-chokidar": "2.1.7",
"vscode-minimist": "^1.2.1",
"vscode-proxy-agent": "0.4.0",
"vscode-ripgrep": "^1.5.6",
"vscode-ripgrep": "^1.5.7",
"vscode-textmate": "^4.2.2",
"xterm": "3.15.0-beta108",
"xterm-addon-search": "0.2.0-beta5",
......
......@@ -1139,10 +1139,10 @@ vscode-proxy-agent@0.4.0:
https-proxy-agent "2.2.1"
socks-proxy-agent "4.0.1"
vscode-ripgrep@^1.5.6:
version "1.5.6"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.6.tgz#93bf5c99ca5f8248950a305e224f6ca153c30af4"
integrity sha512-WRIM9XpUj6dsfdAmuI3ANbmT1ysPUVsYy/2uCLDHJa9kbiB4T7uGvFnnc0Rgx2qQnyRAwL7PeWaFgUljPPxf2g==
vscode-ripgrep@^1.5.7:
version "1.5.7"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.7.tgz#acb6b548af488a4bca5d0f1bb5faf761343289ce"
integrity sha512-/Vsz/+k8kTvui0q3O74pif9FK0nKopgFTiGNVvxicZANxtSA8J8gUE9GQ/4dpi7D/2yI/YVORszwVskFbz46hQ==
vscode-textmate@^4.2.2:
version "4.2.2"
......
......@@ -4,7 +4,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# test that VSCode wasn't installed inside WSL
if grep -qi Microsoft /proc/version; then
if grep -qi Microsoft /proc/version && [ -z "$DONT_PROMPT_WSL_INSTALL" ]; then
echo "To use VS Code with the Windows Subsystem for Linux, please install VS Code in Windows and uninstall the Linux version in WSL. You can then use the '@@PRODNAME@@' command in a WSL terminal just as you would in a normal command prompt." 1>&2
read -e -p "Do you want to continue anyways ? [y/N] " YN
......
......@@ -2,7 +2,7 @@
Name=@@NAME_LONG@@ - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/@@NAME@@/@@NAME@@ --open-url %U
Exec=@@EXEC@@ --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
......
......@@ -2,7 +2,7 @@
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/@@NAME@@/@@NAME@@ --unity-launch %F
Exec=@@EXEC@@ --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
......@@ -14,5 +14,5 @@ Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window %F
Exec=@@EXEC@@ --new-window %F
Icon=@@ICON@@
......@@ -49,16 +49,14 @@ parts:
apps:
@@NAME@@:
command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@
desktop: usr/share/applications/@@NAME@@.desktop
command: electron-launch $SNAP/usr/share/@@NAME@@/@@NAME@@
common-id: @@NAME@@.desktop
environment:
DISABLE_WAYLAND: 1
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
url-handler:
command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@ --open-url
desktop: usr/share/applications/@@NAME@@-url-handler.desktop
command: electron-launch $SNAP/usr/share/@@NAME@@/@@NAME@@ --open-url
environment:
DISABLE_WAYLAND: 1
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
\ No newline at end of file
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
......@@ -47,6 +47,7 @@ function code() {
export VSCODE_CLI=1
export ELECTRON_ENABLE_STACK_DUMPING=1
export ELECTRON_ENABLE_LOGGING=1
export VSCODE_LOGS=
# Launch Code
exec "$CODE" . "$@"
......
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<!-- Content Security Policy -->
<meta
http-equiv="Content-Security-Policy"
content="
default-src 'self';
img-src 'self' https: data: blob:;
media-src 'none';
script-src 'self';
style-src 'self' 'unsafe-inline';
font-src 'self' blob:;
">
<title>Visual Studio Code</title>
<!-- Styling -->
<style type="text/css">
html {
height: 100%;
}
body {
box-sizing: border-box;
min-height: 100%;
margin: 0;
padding: 15px 30px;
display: flex;
flex-direction: column;
color: white;
font-family: "Segoe UI", "Helvetica Neue", "Helvetica", Arial, sans-serif;
background-color: #373277;
}
.branding {
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5pY29uLWNhbnZhcy10cmFuc3BhcmVudHtmaWxsOiNmNmY2ZjY7b3BhY2l0eTowO30uaWNvbi13aGl0ZXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5CcmFuZFZpc3VhbFN0dWRpb0NvZGUyMDE3UlRXXzI0eF93aGl0ZV8yNHg8L3RpdGxlPjxwYXRoIGNsYXNzPSJpY29uLWNhbnZhcy10cmFuc3BhcmVudCIgZD0iTTI0LDBWMjRIMFYwWiIvPjxwYXRoIGNsYXNzPSJpY29uLXdoaXRlIiBkPSJNMjQsMi41VjIxLjVMMTgsMjQsMCwxOC41di0uNTYxbDE4LDEuNTQ1VjBaTTEsMTMuMTExLDQuMzg1LDEwLDEsNi44ODlsMS40MTgtLjgyN0w1Ljg1Myw4LjY1LDEyLDNsMywxLjQ1NlYxNS41NDRMMTIsMTcsNS44NTMsMTEuMzUsMi40MTksMTMuOTM5Wk03LjY0NCwxMCwxMiwxMy4yODNWNi43MTdaIi8+PC9zdmc+");
background-size: 24px;
background-repeat: no-repeat;
background-position: left 50%;
padding-left: 36px;
font-size: 20px;
letter-spacing: -0.04rem;
font-weight: 400;
color: white;
text-decoration: none;
}
.message-container {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
margin: 0 30px;
}
.message {
font-weight: 300;
font-size: 1.3rem;
}
</style>
</head>
<body>
<span class="branding">
Visual Studio Code
</span>
<div class="message-container">
<div class="message">
You can close this page now.
</div>
</div>
</body>
</html>
......@@ -37,7 +37,6 @@
<!-- Prefetch to avoid waterfall -->
<link rel="prefetch" href="./static/node_modules/semver-umd/lib/semver-umd.js">
<link rel="prefetch" href="./static/out/vs/code/browser/workbench/web.main.js"> <!--TODO@ben: Why is it not built -->
<link rel="prefetch" href="./static/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js">
</head>
......@@ -63,7 +62,7 @@
<script src="./static/out/vs/loader.js"></script>
<script src="./static/out/vs/workbench/workbench.web.api.nls.js"></script>
<script src="./static/out/vs/workbench/workbench.web.api.js"></script>
<!-- <script src="./static/out/vs/code/browser/workbench/web.main.js"></script> TODO@ben: Why is it not built-->
<script src="./static/out/vs/code/browser/workbench/web.main.js"></script>
<script>
require(['vs/code/browser/workbench/web.main'], function (web) {
web.main();
......
......@@ -3,30 +3,32 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IAnchor } from 'vs/base/browser/ui/contextview/contextview';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Disposable } from 'vs/base/common/lifecycle';
import { escapeRegExpCharacters } from 'vs/base/common/strings';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EditorAction, EditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';
import { IPosition } from 'vs/editor/common/core/position';
import { IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { CodeAction } from 'vs/editor/common/modes';
import { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction';
import { CodeActionUi } from 'vs/editor/contrib/codeAction/codeActionUi';
import { MessageController } from 'vs/editor/contrib/message/messageController';
import * as nls from 'vs/nls';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
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 { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { IMarkerService } from 'vs/platform/markers/common/markers';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IEditorProgressService } from 'vs/platform/progress/common/progress';
import { CodeActionModel, CodeActionsState, SUPPORTED_CODE_ACTIONS } from './codeActionModel';
import { CodeActionAutoApply, CodeActionFilter, CodeActionKind, CodeActionTrigger } from './codeActionTrigger';
import { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction';
import { IAnchor } from 'vs/base/browser/ui/contextview/contextview';
import { IPosition } from 'vs/editor/common/core/position';
function contextKeyForSupportedActions(kind: CodeActionKind) {
return ContextKeyExpr.regex(
......@@ -56,6 +58,7 @@ export class QuickFixController extends Disposable implements IEditorContributio
@IKeybindingService keybindingService: IKeybindingService,
@ICommandService private readonly _commandService: ICommandService,
@IBulkEditService private readonly _bulkEditService: IBulkEditService,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
) {
super();
......@@ -107,21 +110,42 @@ export class QuickFixController extends Disposable implements IEditorContributio
}
private _applyCodeAction(action: CodeAction): Promise<void> {
return applyCodeAction(action, this._bulkEditService, this._commandService, this._editor);
return this._instantiationService.invokeFunction(applyCodeAction, action, this._bulkEditService, this._commandService, this._editor);
}
}
export async function applyCodeAction(
accessor: ServicesAccessor,
action: CodeAction,
bulkEditService: IBulkEditService,
commandService: ICommandService,
editor?: ICodeEditor,
): Promise<void> {
const notificationService = accessor.get(INotificationService);
if (action.edit) {
await bulkEditService.apply(action.edit, { editor });
}
if (action.command) {
await commandService.executeCommand(action.command.id, ...(action.command.arguments || []));
try {
await commandService.executeCommand(action.command.id, ...(action.command.arguments || []));
} catch (err) {
const message = asMessage(err);
notificationService.error(
typeof message === 'string'
? message
: nls.localize('applyCodeActionFailed', "An unknown error occurred while applying the code action"));
}
}
}
function asMessage(err: any): string | undefined {
if (typeof err === 'string') {
return err;
} else if (err instanceof Error && typeof err.message === 'string') {
return err.message;
} else {
return undefined;
}
}
......
......@@ -23,6 +23,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
import * as colors from 'vs/platform/theme/common/colorRegistry';
import { withNullAsUndefined } from 'vs/base/common/types';
import { ILabelService } from 'vs/platform/label/common/label';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
registerThemingParticipant((theme, collector) => {
......@@ -444,7 +445,7 @@ export class SnippetSession {
snippet.resolveVariables(new CompositeSnippetVariableResolver([
modelBasedVariableResolver,
new ClipboardBasedVariableResolver(clipboardText, idx, indexedSelections.length),
new ClipboardBasedVariableResolver(clipboardText, idx, indexedSelections.length, editor.getOption(EditorOption.multiCursorPaste) === 'spread'),
new SelectionBasedVariableResolver(model, selection),
new CommentBasedVariableResolver(model),
new TimeBasedVariableResolver,
......
......@@ -169,7 +169,8 @@ export class ClipboardBasedVariableResolver implements VariableResolver {
constructor(
private readonly _clipboardText: string | undefined,
private readonly _selectionIdx: number,
private readonly _selectionCount: number
private readonly _selectionCount: number,
private readonly _spread: boolean
) {
//
}
......@@ -183,12 +184,16 @@ export class ClipboardBasedVariableResolver implements VariableResolver {
return undefined;
}
const lines = this._clipboardText.split(/\r\n|\n|\r/).filter(s => !isFalsyOrWhitespace(s));
if (lines.length === this._selectionCount) {
return lines[this._selectionIdx];
} else {
return this._clipboardText;
// `spread` is assigning each cursor a line of the clipboard
// text whenever there the line count equals the cursor count
// and when enabled
if (this._spread) {
const lines = this._clipboardText.split(/\r\n|\n|\r/).filter(s => !isFalsyOrWhitespace(s));
if (lines.length === this._selectionCount) {
return lines[this._selectionIdx];
}
}
return this._clipboardText;
}
}
export class CommentBasedVariableResolver implements VariableResolver {
......
......@@ -236,26 +236,28 @@ suite('Snippet Variables Resolver', function () {
test('Add variable to insert value from clipboard to a snippet #40153', function () {
assertVariableResolve(new ClipboardBasedVariableResolver(undefined, 1, 0), 'CLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver(undefined, 1, 0, true), 'CLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver(null!, 1, 0), 'CLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver(null!, 1, 0, true), 'CLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver('', 1, 0), 'CLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver('', 1, 0, true), 'CLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver('foo', 1, 0), 'CLIPBOARD', 'foo');
assertVariableResolve(new ClipboardBasedVariableResolver('foo', 1, 0, true), 'CLIPBOARD', 'foo');
assertVariableResolve(new ClipboardBasedVariableResolver('foo', 1, 0), 'foo', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver('foo', 1, 0), 'cLIPBOARD', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver('foo', 1, 0, true), 'foo', undefined);
assertVariableResolve(new ClipboardBasedVariableResolver('foo', 1, 0, true), 'cLIPBOARD', undefined);
});
test('Add variable to insert value from clipboard to a snippet #40153', function () {
assertVariableResolve(new ClipboardBasedVariableResolver('line1', 1, 2), 'CLIPBOARD', 'line1');
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2\nline3', 1, 2), 'CLIPBOARD', 'line1\nline2\nline3');
assertVariableResolve(new ClipboardBasedVariableResolver('line1', 1, 2, true), 'CLIPBOARD', 'line1');
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2\nline3', 1, 2, true), 'CLIPBOARD', 'line1\nline2\nline3');
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2', 1, 2), 'CLIPBOARD', 'line2');
resolver = new ClipboardBasedVariableResolver('line1\nline2', 0, 2);
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2', 0, 2), 'CLIPBOARD', 'line1');
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2', 1, 2, true), 'CLIPBOARD', 'line2');
resolver = new ClipboardBasedVariableResolver('line1\nline2', 0, 2, true);
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2', 0, 2, true), 'CLIPBOARD', 'line1');
assertVariableResolve(new ClipboardBasedVariableResolver('line1\nline2', 0, 2, false), 'CLIPBOARD', 'line1\nline2');
});
......
......@@ -71,17 +71,13 @@ export interface ParsedArgs {
'driver-verbose'?: boolean;
remote?: string;
'disable-user-env-probe'?: boolean;
'enable-remote-auto-shutdown'?: boolean;
'disable-inspect'?: boolean;
'force'?: boolean;
'gitCredential'?: string;
// node flags
'js-flags'?: string;
'disable-gpu'?: boolean;
'nolazy'?: boolean;
// Web flags
'web-user-data-dir'?: string;
}
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
......
......@@ -40,13 +40,14 @@ type OptionTypeName<T> =
T extends undefined ? 'undefined' :
'unknown';
export const OPTIONS: OptionDescriptions<ParsedArgs> = {
export const OPTIONS: OptionDescriptions<Required<ParsedArgs>> = {
'diff': { type: 'boolean', cat: 'o', alias: 'd', args: ['file', 'file'], description: localize('diff', "Compare two files with each other.") },
'add': { type: 'boolean', cat: 'o', alias: 'a', args: 'folder', description: localize('add', "Add folder(s) to the last active window.") },
'goto': { type: 'boolean', cat: 'o', alias: 'g', args: 'file:line[:character]', description: localize('goto', "Open a file at the path on the specified line and character position.") },
'new-window': { type: 'boolean', cat: 'o', alias: 'n', description: localize('newWindow', "Force to open a new window.") },
'reuse-window': { type: 'boolean', cat: 'o', alias: 'r', description: localize('reuseWindow', "Force to open a file or folder in an already opened window.") },
'wait': { type: 'boolean', cat: 'o', alias: 'w', description: localize('wait', "Wait for the files to be closed before returning.") },
'waitMarkerFilePath': { type: 'string' },
'locale': { type: 'string', cat: 'o', args: 'locale', description: localize('locale', "The locale to use (e.g. en-US or zh-TW).") },
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
'version': { type: 'boolean', cat: 'o', alias: 'v', description: localize('version', "Print version.") },
......@@ -56,6 +57,7 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
'file-uri': { type: 'string[]', cat: 'o', args: 'uri', description: localize('fileUri', "Opens a window with given file uri(s)") },
'extensions-dir': { type: 'string', deprecates: 'extensionHomePath', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
'builtin-extensions-dir': { type: 'string' },
'list-extensions': { type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") },
'show-versions': { type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") },
'category': { type: 'string', cat: 'e', description: localize('category', "Filters installed extensions by provided category, when using --list-extension.") },
......@@ -67,6 +69,8 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
'log': { type: 'string', cat: 't', args: 'level', description: localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.") },
'status': { type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") },
'prof-startup': { type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") },
'prof-append-timers': { type: 'string' },
'prof-startup-prefix': { type: 'string' },
'disable-extensions': { type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") },
'disable-extension': { type: 'string[]', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") },
......@@ -94,6 +98,7 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
'disable-telemetry': { type: 'boolean' },
'disable-updates': { type: 'boolean' },
'disable-crash-reporter': { type: 'boolean' },
'disable-user-env-probe': { type: 'boolean' },
'skip-add-to-recently-opened': { type: 'boolean' },
'unity-launch': { type: 'boolean' },
'open-url': { type: 'boolean' },
......@@ -101,12 +106,14 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
'file-chmod': { type: 'boolean' },
'driver-verbose': { type: 'boolean' },
'force': { type: 'boolean' },
'trace': { type: 'boolean' },
'trace-category-filter': { type: 'string' },
'trace-options': { type: 'string' },
'disable-inspect': { type: 'boolean' },
'js-flags': { type: 'string' }, // chrome js flags
'nolazy': { type: 'boolean' }, // node inspect
'_urls': { type: 'string[]' },
_: { type: 'string[]' } // main arguments
};
......@@ -126,6 +133,10 @@ export function parseArgs<T>(args: string[], options: OptionDescriptions<T>, err
const string: string[] = [];
const boolean: string[] = [];
for (let optionId in options) {
if (optionId[0] === '_') {
continue;
}
const o = options[optionId];
if (o.alias) {
alias[optionId] = o.alias;
......
......@@ -104,8 +104,6 @@ export class EnvironmentService implements IEnvironmentService {
return parseUserDataDir(this._args, process);
}
@memoize
get webUserDataHome(): URI { return URI.file(parsePathArg(this._args['web-user-data-dir'], process) || this.userDataPath); }
get appNameLong(): string { return product.nameLong; }
......@@ -285,7 +283,7 @@ function parseDebugPort(debugArg: string | undefined, debugBrkArg: string | unde
return { port, break: brk, debugId };
}
function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
export function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
if (!arg) {
return undefined;
}
......
......@@ -246,7 +246,8 @@ class CodeActionOnSaveParticipant implements ISaveParticipant {
constructor(
@IBulkEditService private readonly _bulkEditService: IBulkEditService,
@ICommandService private readonly _commandService: ICommandService,
@IConfigurationService private readonly _configurationService: IConfigurationService
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
) { }
async participate(editorModel: IResolvedTextFileEditorModel, env: { reason: SaveReason }): Promise<void> {
......@@ -312,7 +313,7 @@ class CodeActionOnSaveParticipant implements ISaveParticipant {
private async applyCodeActions(actionsToRun: readonly CodeAction[]) {
for (const action of actionsToRun) {
await applyCodeAction(action, this._bulkEditService, this._commandService);
await this._instantiationService.invokeFunction(applyCodeAction, action, this._bulkEditService, this._commandService);
}
}
......
......@@ -479,21 +479,26 @@ function appendEditorToolItem(primary: IEditorToolItem, when: ContextKeyExpr | u
MenuRegistry.appendMenuItem(MenuId.EditorTitle, item);
}
const SPLIT_EDITOR_HORIZONTAL_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-dark.svg'));
const SPLIT_EDITOR_HORIZONTAL_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-light.svg'));
const SPLIT_EDITOR_VERTICAL_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-dark.svg'));
const SPLIT_EDITOR_VERTICAL_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-light.svg'));
// Editor Title Menu: Split Editor
appendEditorToolItem(
{
id: SplitEditorAction.ID,
title: nls.localize('splitEditorRight', "Split Editor Right"),
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-dark.svg')),
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-light.svg'))
iconDark: SPLIT_EDITOR_HORIZONTAL_DARK_ICON,
iconLight: SPLIT_EDITOR_HORIZONTAL_LIGHT_ICON
},
ContextKeyExpr.not('splitEditorsVertically'),
100000, // towards the end
{
id: editorCommands.SPLIT_EDITOR_DOWN,
title: nls.localize('splitEditorDown', "Split Editor Down"),
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-dark.svg')),
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-light.svg'))
iconDark: SPLIT_EDITOR_VERTICAL_DARK_ICON,
iconLight: SPLIT_EDITOR_VERTICAL_LIGHT_ICON
}
);
......@@ -501,19 +506,22 @@ appendEditorToolItem(
{
id: SplitEditorAction.ID,
title: nls.localize('splitEditorDown', "Split Editor Down"),
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-dark.svg')),
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-light.svg'))
iconDark: SPLIT_EDITOR_VERTICAL_DARK_ICON,
iconLight: SPLIT_EDITOR_VERTICAL_LIGHT_ICON
},
ContextKeyExpr.has('splitEditorsVertically'),
100000, // towards the end
{
id: editorCommands.SPLIT_EDITOR_RIGHT,
title: nls.localize('splitEditorRight', "Split Editor Right"),
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-dark.svg')),
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-light.svg'))
iconDark: SPLIT_EDITOR_HORIZONTAL_DARK_ICON,
iconLight: SPLIT_EDITOR_HORIZONTAL_LIGHT_ICON
}
);
const CLOSE_ALL_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-dark.svg'));
const CLOSE_ALL_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-light.svg'));
// Editor Title Menu: Close Group (tabs disabled)
appendEditorToolItem(
{
......@@ -527,8 +535,8 @@ appendEditorToolItem(
{
id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
title: nls.localize('closeAll', "Close All"),
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-dark.svg')),
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-light.svg'))
iconDark: CLOSE_ALL_DARK_ICON,
iconLight: CLOSE_ALL_LIGHT_ICON
}
);
......@@ -544,8 +552,8 @@ appendEditorToolItem(
{
id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
title: nls.localize('closeAll', "Close All"),
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-dark.svg')),
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-light.svg'))
iconDark: CLOSE_ALL_DARK_ICON,
iconLight: CLOSE_ALL_LIGHT_ICON
}
);
......
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><circle fill="#C5C5C5" cx="8" cy="8" r="4"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><circle fill="#C5C5C5" cx="8" cy="8" r="4"/></svg>
\ No newline at end of file
......@@ -272,13 +272,16 @@ registerEditorContribution(ToggleWordWrapController);
registerEditorAction(ToggleWordWrapAction);
const WORD_WRAP_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-dark.svg'));
const WORD_WRAP_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-light.svg'));
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: {
id: TOGGLE_WORD_WRAP_ID,
title: nls.localize('unwrapMinified', "Disable wrapping for this file"),
iconLocation: {
dark: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-dark.svg')),
light: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-light.svg'))
dark: WORD_WRAP_DARK_ICON,
light: WORD_WRAP_LIGHT_ICON
}
},
group: 'navigation',
......@@ -294,8 +297,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
id: TOGGLE_WORD_WRAP_ID,
title: nls.localize('wrapMinified', "Enable wrapping for this file"),
iconLocation: {
dark: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-dark.svg')),
light: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-light.svg'))
dark: WORD_WRAP_DARK_ICON,
light: WORD_WRAP_LIGHT_ICON
}
},
group: 'navigation',
......
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 8C4 5.79086 5.79086 4 8 4C10.2091 4 12 5.79086 12 8C12 10.2091 10.2091 12 8 12C5.79086 12 4 10.2091 4 8ZM6 10L6 9L10 9L10 10L6 10ZM6 6L6 7L10 7L10 6L6 6Z" fill="#848484"/>
</svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 10.75C9.51878 10.75 10.75 9.51878 10.75 8C10.75 6.48122 9.51878 5.25 8 5.25C6.48122 5.25 5.25 6.48122 5.25 8C5.25 9.51878 6.48122 10.75 8 10.75ZM8 12C10.2091 12 12 10.2091 12 8C12 5.79086 10.2091 4 8 4C5.79086 4 4 5.79086 4 8C4 10.2091 5.79086 12 8 12ZM9.5 6.5V7.5H6.5V6.5H9.5ZM9.5 9.5V8.5H6.5V9.5H9.5Z" fill="#848484"/>
</svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.065 13H15v2H2.056v-2h5.009zm3.661-12H7.385L8.44 2.061 7.505 3H15V1h-4.274zM3.237 9H2.056v2H15V9H3.237zm4.208-4l.995 1-.995 1H15V5H7.445z" fill="#C5C5C5"/><path d="M5.072 4.03L7.032 6 5.978 7.061l-1.96-1.97-1.961 1.97L1 6l1.96-1.97L1 2.061 2.056 1l1.96 1.97L5.977 1l1.057 1.061L5.072 4.03z" fill="#F48771"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#fff" d="M8 1c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zm2.45 2.8c.58 0 1.05.627 1.05 1.4 0 .773-.47 1.4-1.05 1.4-.58 0-1.05-.627-1.05-1.4 0-.773.47-1.4 1.05-1.4zm-4.9 0c.58 0 1.05.627 1.05 1.4 0 .773-.47 1.4-1.05 1.4s-1.05-.627-1.05-1.4c0-.773.47-1.4 1.05-1.4zm6.901 5.775c-.668 1.884-2.456 3.15-4.451 3.15-1.995 0-3.784-1.266-4.451-3.149-.097-.273.046-.573.319-.67.275-.097.574.047.67.32.519 1.465 1.91 2.45 3.461 2.45s2.941-.984 3.461-2.45c.097-.273.4-.417.67-.32.274.096.418.396.321.669z"/></svg>
\ No newline at end of file
......@@ -925,7 +925,7 @@ async function openExplorerAndCreate(accessor: ServicesAccessor, isFolder: boole
folder.addChild(newStat);
const onSuccess = async (value: string) => {
const onSuccess = (value: string): Promise<void> => {
const createPromise = isFolder ? fileService.createFolder(resources.joinPath(folder.resource, value)) : textFileService.create(resources.joinPath(folder.resource, value));
return createPromise.then(created => {
refreshIfSeparator(value, explorerService);
......@@ -943,8 +943,6 @@ async function openExplorerAndCreate(accessor: ServicesAccessor, isFolder: boole
explorerService.setEditable(newStat, null);
if (success) {
onSuccess(value);
} else {
explorerService.select(folder.resource).then(undefined, onUnexpectedError);
}
}
});
......
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#424242" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>
\ No newline at end of file
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.62132 8.08579L7.91421 7.37868L6.5 8.79289L5.08579 7.37868L4.37868 8.08579L5.79289 9.5L4.37868 10.9142L5.08579 11.6213L6.5 10.2071L7.91421 11.6213L8.62132 10.9142L7.20711 9.5L8.62132 8.08579Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3L6 2H13L14 3V10L13 11H11V13L10 14H3L2 13V6L3 5H5V3ZM6 5H10L11 6V10H13V3H6V5ZM10 6H3V13H10V6Z" fill="white"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#F6F6F6" d="M16 2.6L13.4 0H6v6H0v10h10v-6h6z"/><g fill="#00539C"><path d="M5 7h1v2H5zM11 1h1v2h-1zM13 1v3H9V1H7v5h.4L10 8.6V9h5V3zM7 10H3V7H1v8h8V9L7 7z"/></g></svg>
\ No newline at end of file
......@@ -6,7 +6,7 @@
import * as nls from 'vs/nls';
import { URI } from 'vs/base/common/uri';
import * as perf from 'vs/base/common/performance';
import { Action, IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';
import { IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';
import { memoize } from 'vs/base/common/decorators';
import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, IExplorerService, ExplorerResourceCut, ExplorerResourceMoveableToTrash } from 'vs/workbench/contrib/files/common/files';
import { NewFolderAction, NewFileAction, FileCopiedContext, RefreshExplorerView, CollapseExplorerView } from 'vs/workbench/contrib/files/browser/fileActions';
......@@ -68,6 +68,7 @@ export class ExplorerView extends ViewletPanel {
private shouldRefresh = true;
private dragHandler!: DelayedDragHandler;
private autoReveal = false;
private actions: IAction[] | undefined;
constructor(
options: IViewletPanelOptions,
......@@ -170,7 +171,12 @@ export class ExplorerView extends ViewletPanel {
}));
this._register(this.explorerService.onDidChangeRoots(() => this.setTreeInput()));
this._register(this.explorerService.onDidChangeItem(e => this.refresh(e.recursive, e.item)));
this._register(this.explorerService.onDidChangeItem(e => {
if (this.explorerService.isEditable(undefined)) {
this.tree.domFocus();
}
this.refresh(e.recursive, e.item);
}));
this._register(this.explorerService.onDidChangeEditable(async e => {
const isEditing = !!this.explorerService.getEditableData(e);
......@@ -218,14 +224,16 @@ export class ExplorerView extends ViewletPanel {
}
getActions(): IAction[] {
const actions: Action[] = [];
actions.push(this.instantiationService.createInstance(NewFileAction));
actions.push(this.instantiationService.createInstance(NewFolderAction));
actions.push(this.instantiationService.createInstance(RefreshExplorerView, RefreshExplorerView.ID, RefreshExplorerView.LABEL));
actions.push(this.instantiationService.createInstance(CollapseExplorerView, CollapseExplorerView.ID, CollapseExplorerView.LABEL));
return actions;
if (!this.actions) {
this.actions = [
this.instantiationService.createInstance(NewFileAction),
this.instantiationService.createInstance(NewFolderAction),
this.instantiationService.createInstance(RefreshExplorerView, RefreshExplorerView.ID, RefreshExplorerView.LABEL),
this.instantiationService.createInstance(CollapseExplorerView, CollapseExplorerView.ID, CollapseExplorerView.LABEL)
];
this.actions.forEach(a => this._register(a));
}
return this.actions;
}
focus(): void {
......@@ -334,6 +342,13 @@ export class ExplorerView extends ViewletPanel {
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
this._register(this.tree.onDidScroll(e => {
let editable = this.explorerService.getEditable();
if (e.scrollTopChanged && editable && this.tree.getRelativeTop(editable.stat) === null) {
editable.data.onFinish('', false);
}
}));
// save view state on shutdown
this._register(this.storageService.onWillSaveState(() => {
this.storageService.store(ExplorerView.TREE_VIEW_STATE_STORAGE_KEY, JSON.stringify(this.tree.getViewState()), StorageScope.WORKSPACE);
......
......@@ -228,43 +228,37 @@ export class FilesRenderer implements ITreeRenderer<ExplorerItem, FuzzyScore, IF
inputBox.focus();
inputBox.select({ start: 0, end: lastDot > 0 && !stat.isDirectory ? lastDot : value.length });
const done = once(async (success: boolean, blur: boolean) => {
const done = once((success: boolean, finishEditing: boolean) => {
label.element.style.display = 'none';
const value = inputBox.value;
dispose(toDispose);
container.removeChild(label.element);
editableData.onFinish(value, success);
label.element.remove();
if (finishEditing) {
editableData.onFinish(value, success);
}
});
// It can happen that the tree re-renders this node. When that happens,
// we're gonna get a blur event first and only after an element disposable.
// Because of that, we should setTimeout the blur handler to differentiate
// between the blur happening because of a unrender or because of a user action.
let ignoreBlur = false;
const toDispose = [
inputBox,
DOM.addStandardDisposableListener(inputBox.inputElement, DOM.EventType.KEY_DOWN, (e: IKeyboardEvent) => {
if (e.equals(KeyCode.Enter)) {
if (inputBox.validate()) {
done(true, false);
done(true, true);
}
} else if (e.equals(KeyCode.Escape)) {
done(false, false);
done(false, true);
}
}),
DOM.addDisposableListener(inputBox.inputElement, DOM.EventType.BLUR, () => {
setTimeout(() => {
if (!ignoreBlur) {
done(inputBox.isInputValid(), true);
}
}, 0);
done(inputBox.isInputValid(), true);
}),
label,
styler
];
return toDisposable(() => ignoreBlur = true);
return toDisposable(() => {
done(false, false);
});
}
disposeElement?(element: ITreeNode<ExplorerItem, FuzzyScore>, index: number, templateData: IFileTemplateData): void {
......
......@@ -140,6 +140,10 @@ export class ExplorerService implements IExplorerService {
return !!this.cutItems && this.cutItems.indexOf(item) >= 0;
}
getEditable(): { stat: ExplorerItem, data: IEditableData } | undefined {
return this.editable;
}
getEditableData(stat: ExplorerItem): IEditableData | undefined {
return this.editable && this.editable.stat === stat ? this.editable.data : undefined;
}
......
......@@ -51,6 +51,7 @@ export interface IExplorerService {
readonly onDidCopyItems: Event<{ items: ExplorerItem[], cut: boolean, previouslyCutItems: ExplorerItem[] | undefined }>;
setEditable(stat: ExplorerItem, data: IEditableData | null): void;
getEditable(): { stat: ExplorerItem, data: IEditableData } | undefined;
getEditableData(stat: ExplorerItem): IEditableData | undefined;
// If undefined is passed checks if any element is currently being edited.
isEditable(stat: ExplorerItem | undefined): boolean;
......
......@@ -565,7 +565,7 @@ export class MarkerViewModel extends Disposable {
true,
() => {
return this.openFileAtMarker(this.marker)
.then(() => applyCodeAction(codeAction, this.bulkEditService, this.commandService));
.then(() => this.instantiationService.invokeFunction(applyCodeAction, codeAction, this.bulkEditService, this.commandService));
}));
}
......
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#424242"/><rect height="3" width="11" y="7" x="3" fill="#424242"/></svg>
\ No newline at end of file
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#C5C5C5"/><rect height="3" width="11" y="7" x="3" fill="#C5C5C5"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="-0.994 0 16 16" enable-background="new -0.994 0 16 16"><path fill="#C5C5C5" d="M13 6c0 1.461-.636 2.846-1.746 3.797l-5.584 4.951-1.324-1.496 5.595-4.962c.678-.582 1.061-1.413 1.061-2.29 0-1.654-1.345-3-2.997-3-.71 0-1.399.253-1.938.713l-1.521 1.287h2.448l-1.998 2h-3.996v-4l1.998-2v2.692l1.775-1.504c.899-.766 2.047-1.188 3.232-1.188 2.754 0 4.995 2.243 4.995 5z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="-0.994 0 16 16" enable-background="new -0.994 0 16 16"><path fill="#424242" d="M13 6c0 1.461-.636 2.846-1.746 3.797l-5.584 4.951-1.324-1.496 5.595-4.962c.678-.582 1.061-1.413 1.061-2.29 0-1.654-1.345-3-2.997-3-.71 0-1.399.253-1.938.713l-1.521 1.287h2.448l-1.998 2h-3.996v-4l1.998-2v2.692l1.775-1.504c.899-.766 2.047-1.188 3.232-1.188 2.754 0 4.995 2.243 4.995 5z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#E8E8E8" d="M6 4v8l4-4-4-4zm1 2.414L8.586 8 7 9.586V6.414z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#646465" d="M6 4v8l4-4-4-4zm1 2.414L8.586 8 7 9.586V6.414z"/></svg>
\ No newline at end of file
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 2.98361V2.97184V2H5.91083C5.59743 2 5.29407 2.06161 5.00128 2.18473C4.70818 2.30798 4.44942 2.48474 4.22578 2.71498C4.00311 2.94422 3.83792 3.19498 3.73282 3.46766L3.73233 3.46898C3.63382 3.7352 3.56814 4.01201 3.53533 4.29917L3.53519 4.30053C3.50678 4.5805 3.4987 4.86844 3.51084 5.16428C3.52272 5.45379 3.52866 5.74329 3.52866 6.03279C3.52866 6.23556 3.48974 6.42594 3.412 6.60507L3.4116 6.60601C3.33687 6.78296 3.23423 6.93866 3.10317 7.07359C2.97644 7.20405 2.82466 7.31055 2.64672 7.3925C2.4706 7.46954 2.28497 7.5082 2.08917 7.5082H2V7.6V8.4V8.4918H2.08917C2.28465 8.4918 2.47001 8.53238 2.64601 8.61334L2.64742 8.61396C2.82457 8.69157 2.97577 8.79762 3.10221 8.93161L3.10412 8.93352C3.23428 9.0637 3.33659 9.21871 3.41129 9.39942L3.41201 9.40108C3.48986 9.58047 3.52866 9.76883 3.52866 9.96721C3.52866 10.2567 3.52272 10.5462 3.51084 10.8357C3.4987 11.1316 3.50677 11.4215 3.53516 11.7055L3.53535 11.7072C3.56819 11.9903 3.63387 12.265 3.73232 12.531L3.73283 12.5323C3.83793 12.805 4.00311 13.0558 4.22578 13.285C4.44942 13.5153 4.70818 13.692 5.00128 13.8153C5.29407 13.9384 5.59743 14 5.91083 14H6V13.2V13.0164H5.91083C5.71095 13.0164 5.52346 12.9777 5.34763 12.9008C5.17396 12.8191 5.02194 12.7126 4.89086 12.5818C4.76386 12.4469 4.66104 12.2911 4.58223 12.1137C4.50838 11.9346 4.47134 11.744 4.47134 11.541C4.47134 11.3127 4.4753 11.0885 4.48321 10.8686C4.49125 10.6411 4.49127 10.4195 4.48324 10.2039C4.47914 9.98246 4.46084 9.76883 4.42823 9.56312C4.39513 9.35024 4.33921 9.14757 4.26039 8.95536C4.18091 8.76157 4.07258 8.57746 3.93616 8.40298C3.82345 8.25881 3.68538 8.12462 3.52283 8C3.68538 7.87538 3.82345 7.74119 3.93616 7.59702C4.07258 7.42254 4.18091 7.23843 4.26039 7.04464C4.33913 6.85263 4.39513 6.65175 4.42826 6.44285C4.46082 6.2333 4.47914 6.01973 4.48324 5.80219C4.49127 5.58262 4.49125 5.36105 4.48321 5.13749C4.4753 4.9134 4.47134 4.68725 4.47134 4.45902C4.47134 4.26019 4.50833 4.07152 4.58238 3.89205C4.66135 3.71034 4.76421 3.55475 4.89086 3.42437C5.02193 3.28942 5.17461 3.18275 5.34802 3.10513C5.5238 3.02427 5.71113 2.98361 5.91083 2.98361H6ZM10 13.0164V13.0282V14H10.0892C10.4026 14 10.7059 13.9384 10.9987 13.8153C11.2918 13.692 11.5506 13.5153 11.7742 13.285C11.9969 13.0558 12.1621 12.805 12.2672 12.5323L12.2677 12.531C12.3662 12.2648 12.4319 11.988 12.4647 11.7008L12.4648 11.6995C12.4932 11.4195 12.5013 11.1316 12.4892 10.8357C12.4773 10.5462 12.4713 10.2567 12.4713 9.96721C12.4713 9.76444 12.5103 9.57406 12.588 9.39493L12.5884 9.39399C12.6631 9.21704 12.7658 9.06134 12.8968 8.92642C13.0236 8.79595 13.1753 8.68945 13.3533 8.6075C13.5294 8.53046 13.715 8.4918 13.9108 8.4918H14V8.4V7.6V7.5082H13.9108C13.7153 7.5082 13.53 7.46762 13.354 7.38666L13.3526 7.38604C13.1754 7.30844 13.0242 7.20238 12.8978 7.06839L12.8959 7.06648C12.7657 6.9363 12.6634 6.78129 12.5887 6.60058L12.588 6.59892C12.5101 6.41953 12.4713 6.23117 12.4713 6.03279C12.4713 5.74329 12.4773 5.45379 12.4892 5.16428C12.5013 4.86842 12.4932 4.57848 12.4648 4.29454L12.4646 4.29285C12.4318 4.00971 12.3661 3.73502 12.2677 3.46897L12.2672 3.46766C12.1621 3.19499 11.9969 2.94422 11.7742 2.71498C11.5506 2.48474 11.2918 2.30798 10.9987 2.18473C10.7059 2.06161 10.4026 2 10.0892 2H10V2.8V2.98361H10.0892C10.2891 2.98361 10.4765 3.0223 10.6524 3.09917C10.826 3.18092 10.9781 3.28736 11.1091 3.41823C11.2361 3.55305 11.339 3.70889 11.4178 3.88628C11.4916 4.0654 11.5287 4.25596 11.5287 4.45902C11.5287 4.68727 11.5247 4.91145 11.5168 5.13142C11.5088 5.35894 11.5087 5.58049 11.5168 5.79605C11.5209 6.01754 11.5392 6.23117 11.5718 6.43688C11.6049 6.64976 11.6608 6.85243 11.7396 7.04464C11.8191 7.23843 11.9274 7.42254 12.0638 7.59702C12.1765 7.74119 12.3146 7.87538 12.4772 8C12.3146 8.12462 12.1765 8.25881 12.0638 8.40298C11.9274 8.57746 11.8191 8.76157 11.7396 8.95536C11.6609 9.14737 11.6049 9.34825 11.5717 9.55715C11.5392 9.7667 11.5209 9.98027 11.5168 10.1978C11.5087 10.4174 11.5087 10.6389 11.5168 10.8625C11.5247 11.0866 11.5287 11.3128 11.5287 11.541C11.5287 11.7398 11.4917 11.9285 11.4176 12.1079C11.3386 12.2897 11.2358 12.4452 11.1091 12.5756C10.9781 12.7106 10.8254 12.8173 10.652 12.8949C10.4762 12.9757 10.2889 13.0164 10.0892 13.0164H10Z" fill="#C5C5C5"/>
</svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 2.98361V2.97184V2H5.91083C5.59743 2 5.29407 2.06161 5.00128 2.18473C4.70818 2.30798 4.44942 2.48474 4.22578 2.71498C4.00311 2.94422 3.83792 3.19498 3.73282 3.46766L3.73233 3.46898C3.63382 3.7352 3.56814 4.01201 3.53533 4.29917L3.53519 4.30053C3.50678 4.5805 3.4987 4.86844 3.51084 5.16428C3.52272 5.45379 3.52866 5.74329 3.52866 6.03279C3.52866 6.23556 3.48974 6.42594 3.412 6.60507L3.4116 6.60601C3.33687 6.78296 3.23423 6.93866 3.10317 7.07359C2.97644 7.20405 2.82466 7.31055 2.64672 7.3925C2.4706 7.46954 2.28497 7.5082 2.08917 7.5082H2V7.6V8.4V8.4918H2.08917C2.28465 8.4918 2.47001 8.53238 2.64601 8.61334L2.64742 8.61396C2.82457 8.69157 2.97577 8.79762 3.10221 8.93161L3.10412 8.93352C3.23428 9.0637 3.33659 9.21871 3.41129 9.39942L3.41201 9.40108C3.48986 9.58047 3.52866 9.76883 3.52866 9.96721C3.52866 10.2567 3.52272 10.5462 3.51084 10.8357C3.4987 11.1316 3.50677 11.4215 3.53516 11.7055L3.53535 11.7072C3.56819 11.9903 3.63387 12.265 3.73232 12.531L3.73283 12.5323C3.83793 12.805 4.00311 13.0558 4.22578 13.285C4.44942 13.5153 4.70818 13.692 5.00128 13.8153C5.29407 13.9384 5.59743 14 5.91083 14H6V13.2V13.0164H5.91083C5.71095 13.0164 5.52346 12.9777 5.34763 12.9008C5.17396 12.8191 5.02194 12.7126 4.89086 12.5818C4.76386 12.4469 4.66104 12.2911 4.58223 12.1137C4.50838 11.9346 4.47134 11.744 4.47134 11.541C4.47134 11.3127 4.4753 11.0885 4.48321 10.8686C4.49125 10.6411 4.49127 10.4195 4.48324 10.2039C4.47914 9.98246 4.46084 9.76883 4.42823 9.56312C4.39513 9.35024 4.33921 9.14757 4.26039 8.95536C4.18091 8.76157 4.07258 8.57746 3.93616 8.40298C3.82345 8.25881 3.68538 8.12462 3.52283 8C3.68538 7.87538 3.82345 7.74119 3.93616 7.59702C4.07258 7.42254 4.18091 7.23843 4.26039 7.04464C4.33913 6.85263 4.39513 6.65175 4.42826 6.44285C4.46082 6.2333 4.47914 6.01973 4.48324 5.80219C4.49127 5.58262 4.49125 5.36105 4.48321 5.13749C4.4753 4.9134 4.47134 4.68725 4.47134 4.45902C4.47134 4.26019 4.50833 4.07152 4.58238 3.89205C4.66135 3.71034 4.76421 3.55475 4.89086 3.42437C5.02193 3.28942 5.17461 3.18275 5.34802 3.10513C5.5238 3.02427 5.71113 2.98361 5.91083 2.98361H6ZM10 13.0164V13.0282V14H10.0892C10.4026 14 10.7059 13.9384 10.9987 13.8153C11.2918 13.692 11.5506 13.5153 11.7742 13.285C11.9969 13.0558 12.1621 12.805 12.2672 12.5323L12.2677 12.531C12.3662 12.2648 12.4319 11.988 12.4647 11.7008L12.4648 11.6995C12.4932 11.4195 12.5013 11.1316 12.4892 10.8357C12.4773 10.5462 12.4713 10.2567 12.4713 9.96721C12.4713 9.76444 12.5103 9.57406 12.588 9.39493L12.5884 9.39399C12.6631 9.21704 12.7658 9.06134 12.8968 8.92642C13.0236 8.79595 13.1753 8.68945 13.3533 8.6075C13.5294 8.53046 13.715 8.4918 13.9108 8.4918H14V8.4V7.6V7.5082H13.9108C13.7153 7.5082 13.53 7.46762 13.354 7.38666L13.3526 7.38604C13.1754 7.30844 13.0242 7.20238 12.8978 7.06839L12.8959 7.06648C12.7657 6.9363 12.6634 6.78129 12.5887 6.60058L12.588 6.59892C12.5101 6.41953 12.4713 6.23117 12.4713 6.03279C12.4713 5.74329 12.4773 5.45379 12.4892 5.16428C12.5013 4.86842 12.4932 4.57848 12.4648 4.29454L12.4646 4.29285C12.4318 4.00971 12.3661 3.73502 12.2677 3.46897L12.2672 3.46766C12.1621 3.19499 11.9969 2.94422 11.7742 2.71498C11.5506 2.48474 11.2918 2.30798 10.9987 2.18473C10.7059 2.06161 10.4026 2 10.0892 2H10V2.8V2.98361H10.0892C10.2891 2.98361 10.4765 3.0223 10.6524 3.09917C10.826 3.18092 10.9781 3.28736 11.1091 3.41823C11.2361 3.55305 11.339 3.70889 11.4178 3.88628C11.4916 4.0654 11.5287 4.25596 11.5287 4.45902C11.5287 4.68727 11.5247 4.91145 11.5168 5.13142C11.5088 5.35894 11.5087 5.58049 11.5168 5.79605C11.5209 6.01754 11.5392 6.23117 11.5718 6.43688C11.6049 6.64976 11.6608 6.85243 11.7396 7.04464C11.8191 7.23843 11.9274 7.42254 12.0638 7.59702C12.1765 7.74119 12.3146 7.87538 12.4772 8C12.3146 8.12462 12.1765 8.25881 12.0638 8.40298C11.9274 8.57746 11.8191 8.76157 11.7396 8.95536C11.6609 9.14737 11.6049 9.34825 11.5717 9.55715C11.5392 9.7667 11.5209 9.98027 11.5168 10.1978C11.5087 10.4174 11.5087 10.6389 11.5168 10.8625C11.5247 11.0866 11.5287 11.3128 11.5287 11.541C11.5287 11.7398 11.4917 11.9285 11.4176 12.1079C11.3386 12.2897 11.2358 12.4452 11.1091 12.5756C10.9781 12.7106 10.8254 12.8173 10.652 12.8949C10.4762 12.9757 10.2889 13.0164 10.0892 13.0164H10Z" fill="#424242"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-bg{fill:#424242;}</style><path class="icon-canvas-transparent" d="M16 16h-16v-16h16v16z" id="canvas"/><path class="icon-vs-out" d="M16 4.28l-11.673 11.72h-4.327v-4.406l11.477-11.594h.308l4.215 4.237v.043z" id="outline" style="display: none;"/><path class="icon-vs-bg" d="M14.598 4.25l-1.688 1.75-3-3 1.688-1.75 3 3zm-5.688-.25l-7 7 3 3 7-7-3-3zm-7.91 8.09v2.91h2.91l-2.91-2.91z" id="iconBg"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#2d2d30;} .icon-vs-out{fill:#2d2d30;} .icon-vs-bg{fill:#c5c5c5;}</style><path class="icon-canvas-transparent" d="M16 16h-16v-16h16v16z" id="canvas"/><path class="icon-vs-out" d="M16 4.28l-11.673 11.72h-4.327v-4.406l11.477-11.594h.308l4.215 4.237v.043z" id="outline" style="display: none;"/><path class="icon-vs-bg" d="M14.598 4.25l-1.688 1.75-3-3 1.688-1.75 3 3zm-5.688-.25l-7 7 3 3 7-7-3-3zm-7.91 8.09v2.91h2.91l-2.91-2.91z" id="iconBg"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>Ellipsis_bold_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M6,7.5A2.5,2.5,0,1,1,3.5,5,2.5,2.5,0,0,1,6,7.5ZM8.5,5A2.5,2.5,0,1,0,11,7.5,2.5,2.5,0,0,0,8.5,5Zm5,0A2.5,2.5,0,1,0,16,7.5,2.5,2.5,0,0,0,13.5,5Z" style="display: none;"/></g><g id="iconBg"><path class="icon-vs-bg" d="M5,7.5A1.5,1.5,0,1,1,3.5,6,1.5,1.5,0,0,1,5,7.5ZM8.5,6A1.5,1.5,0,1,0,10,7.5,1.5,1.5,0,0,0,8.5,6Zm5,0A1.5,1.5,0,1,0,15,7.5,1.5,1.5,0,0,0,13.5,6Z"/></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>Ellipsis_bold_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M6,7.5A2.5,2.5,0,1,1,3.5,5,2.5,2.5,0,0,1,6,7.5ZM8.5,5A2.5,2.5,0,1,0,11,7.5,2.5,2.5,0,0,0,8.5,5Zm5,0A2.5,2.5,0,1,0,16,7.5,2.5,2.5,0,0,0,13.5,5Z" style="display: none;"/></g><g id="iconBg"><path class="icon-vs-bg" d="M5,7.5A1.5,1.5,0,1,1,3.5,6,1.5,1.5,0,0,1,5,7.5ZM8.5,6A1.5,1.5,0,1,0,10,7.5,1.5,1.5,0,0,0,8.5,6Zm5,0A1.5,1.5,0,1,0,15,7.5,1.5,1.5,0,0,0,13.5,6Z"/></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#E8E8E8" d="M11 10H5.344L11 4.414V10z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#646465" d="M11 10H5.344L11 4.414V10z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#C5C5C5" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#75BEFF" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#656565" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#00539C" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#2d2d30" points="13.64,7.396 12.169,2.898 10.706,3.761 11.087,2 6.557,2 6.936,3.762 5.473,2.898 4,7.396 5.682,7.554 4.513,8.561 5.013,9 2,9 2,14 7,14 7,10.747 7.978,11.606 8.82,9.725 9.661,11.602 13.144,8.562 11.968,7.554"/><g fill="#C5C5C5"><path d="M12.301 6.518l-2.772.262 2.086 1.788-1.594 1.392-1.201-2.682-1.201 2.682-1.583-1.392 2.075-1.788-2.771-.262.696-2.126 2.358 1.392-.599-2.784h2.053l-.602 2.783 2.359-1.392.696 2.127z"/><rect x="3" y="10" width="3" height="3"/></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#F6F6F6" points="13.64,7.396 12.169,2.898 10.706,3.761 11.087,2 6.557,2 6.936,3.762 5.473,2.898 4,7.396 5.682,7.554 4.513,8.561 5.013,9 2,9 2,14 7,14 7,10.747 7.978,11.606 8.82,9.725 9.661,11.602 13.144,8.562 11.968,7.554"/><g fill="#424242"><path d="M12.301 6.518l-2.772.262 2.086 1.788-1.594 1.392-1.201-2.682-1.201 2.682-1.583-1.392 2.075-1.788-2.771-.262.696-2.126 2.358 1.392-.599-2.784h2.053l-.602 2.783 2.359-1.392.696 2.127z"/><rect x="3" y="10" width="3" height="3"/></g></svg>
\ No newline at end of file
......@@ -820,8 +820,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
id: SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON,
title: nls.localize('openSettingsJson', "Open Settings (JSON)"),
iconLocation: {
dark: URI.parse(require.toUrl('vs/workbench/contrib/preferences/browser/media/preferences-editor-dark.svg')),
light: URI.parse(require.toUrl('vs/workbench/contrib/preferences/browser/media/preferences-editor-light.svg'))
dark: PREFERENCES_EDITOR_DARK_ICON_URI,
light: PREFERENCES_EDITOR_LIGHT_ICON_URI
}
},
group: 'navigation',
......
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-2 -2 16 16" enable-background="new -2 -2 16 16"><polygon fill="#C5C5C5" points="9,0 4.5,9 3,6 0,6 3,12 6,12 12,0"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon points="5.382,13 2.382,7 6.618,7 7,7.764 9.382,3 13.618,3 8.618,13" fill="#F6F6F6"/><path d="M12 4l-4 8h-2l-2-4h2l1 2 3-6h2z" fill="#424242"/></svg>
\ No newline at end of file
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="path-1-inside-1" fill="white">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.41155 1L9.89605 3.42252L11.9516 2.05214L13.9479 4.04837L12.5775 6.10396L15 6.58846V9.41156L12.5775 9.89606L13.9479 11.9516L11.9516 13.9479L9.89606 12.5775L9.41155 15H6.58845L6.10395 12.5775L4.04838 13.9479L2.05214 11.9516L3.42253 9.89606L1 9.41156V6.58846L3.42252 6.10396L2.05214 4.04839L4.04837 2.05215L6.10395 3.42254L6.58845 1.00002L9.41155 1ZM11.6369 6.94069L11.3207 6.17737L12.6547 4.17642L11.8236 3.3453L9.82263 4.67927L9.05931 4.36311L8.58769 2.00496L7.41231 2.00497L6.94069 4.36313L6.17737 4.67928L4.17642 3.34532L3.34531 4.17643L4.67928 6.17739L4.36309 6.94069L2.00495 7.41232V8.5877L4.36309 9.05932L4.67929 9.82263L3.34531 11.8236L4.17643 12.6547L6.17738 11.3207L6.94068 11.6369L7.41231 13.9951H8.58769L9.05931 11.6369L9.82263 11.3207L11.8236 12.6547L12.6547 11.8236L11.3207 9.82262L11.6369 9.05932L13.995 8.5877V7.41232L11.6369 6.94069ZM9 8C9 8.55228 8.55228 9 8 9C7.44772 9 7 8.55228 7 8C7 7.44772 7.44772 7 8 7C8.55228 7 9 7.44772 9 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z"/>
</mask>
<path d="M9.89605 3.42252L8.91547 3.61864L9.20831 5.08286L10.4507 4.25457L9.89605 3.42252ZM9.41155 1L10.3921 0.803887L10.2314 -6.23587e-06L9.41154 0L9.41155 1ZM11.9516 2.05214L12.6587 1.34503L12.079 0.765344L11.3969 1.22009L11.9516 2.05214ZM13.9479 4.04837L14.7799 4.60307L15.2347 3.92095L14.655 3.34126L13.9479 4.04837ZM12.5775 6.10396L11.7454 5.54925L10.9171 6.79169L12.3814 7.08454L12.5775 6.10396ZM15 6.58846H16V5.76866L15.1961 5.60788L15 6.58846ZM15 9.41156L15.1961 10.3921L16 10.2314V9.41156H15ZM12.5775 9.89606L12.3814 8.91548L10.9172 9.20832L11.7454 10.4508L12.5775 9.89606ZM13.9479 11.9516L14.655 12.6587L15.2347 12.079L14.7799 11.3969L13.9479 11.9516ZM11.9516 13.9479L11.3969 14.7799L12.0791 15.2346L12.6587 14.655L11.9516 13.9479ZM9.89606 12.5775L10.4508 11.7454L9.20832 10.9171L8.91548 12.3814L9.89606 12.5775ZM9.41155 15V16H10.2314L10.3921 15.1961L9.41155 15ZM6.58845 15L5.60787 15.1961L5.76865 16H6.58845V15ZM6.10395 12.5775L7.08453 12.3814L6.79168 10.9172L5.54925 11.7454L6.10395 12.5775ZM4.04838 13.9479L3.34127 14.655L3.92096 15.2347L4.60308 14.7799L4.04838 13.9479ZM2.05214 11.9516L1.22009 11.3969L0.765349 12.0791L1.34504 12.6587L2.05214 11.9516ZM3.42253 9.89606L4.25458 10.4508L5.08287 9.20833L3.61865 8.91548L3.42253 9.89606ZM1 9.41156H0V10.2314L0.803884 10.3921L1 9.41156ZM1 6.58846L0.803884 5.60788L0 5.76866V6.58846H1ZM3.42252 6.10396L3.61864 7.08454L5.08286 6.79169L4.25457 5.54926L3.42252 6.10396ZM2.05214 4.04839L1.34503 3.34128L0.765344 3.92097L1.22009 4.60309L2.05214 4.04839ZM4.04837 2.05215L4.60307 1.2201L3.92096 0.765359L3.34127 1.34505L4.04837 2.05215ZM6.10395 3.42254L5.54925 4.25459L6.79169 5.08288L7.08453 3.61865L6.10395 3.42254ZM6.58845 1.00002L6.58844 2.14739e-05L5.76864 2.77097e-05L5.60787 0.803908L6.58845 1.00002ZM11.3207 6.17737L10.4887 5.62267L10.1926 6.06685L10.3968 6.56005L11.3207 6.17737ZM11.6369 6.94069L10.713 7.32337L10.9173 7.81658L11.4408 7.92127L11.6369 6.94069ZM12.6547 4.17642L13.4867 4.73112L13.9415 4.049L13.3618 3.46931L12.6547 4.17642ZM11.8236 3.3453L12.5307 2.6382L11.951 2.05851L11.2689 2.51325L11.8236 3.3453ZM9.82263 4.67927L9.43997 5.60316L9.93316 5.80743L10.3773 5.51132L9.82263 4.67927ZM9.05931 4.36311L8.07873 4.55923L8.18343 5.08272L8.67665 5.287L9.05931 4.36311ZM8.58769 2.00496L9.56827 1.80884L9.40749 1.00495L8.58768 1.00496L8.58769 2.00496ZM7.41231 2.00497L7.41231 1.00497L6.59251 1.00497L6.43173 1.80885L7.41231 2.00497ZM6.94069 4.36313L7.32335 5.28702L7.81658 5.08273L7.92127 4.55924L6.94069 4.36313ZM6.17737 4.67928L5.62267 5.51133L6.06684 5.80745L6.56003 5.60317L6.17737 4.67928ZM4.17642 3.34532L4.73112 2.51327L4.049 2.05852L3.46932 2.63821L4.17642 3.34532ZM3.34531 4.17643L2.6382 3.46933L2.05851 4.04902L2.51326 4.73113L3.34531 4.17643ZM4.67928 6.17739L5.60315 6.56009L5.80746 6.06688L5.51133 5.62269L4.67928 6.17739ZM4.36309 6.94069L4.55921 7.92128L5.08267 7.81658L5.28697 7.32339L4.36309 6.94069ZM2.00495 7.41232L1.80884 6.43174L1.00495 6.59252V7.41232H2.00495ZM2.00495 8.5877H1.00495V9.4075L1.80884 9.56828L2.00495 8.5877ZM4.36309 9.05932L5.28696 8.67662L5.08266 8.18343L4.55921 8.07874L4.36309 9.05932ZM4.67929 9.82263L5.51134 10.3773L5.80747 9.93314L5.60316 9.43993L4.67929 9.82263ZM3.34531 11.8236L2.51326 11.2689L2.05852 11.951L2.63821 12.5307L3.34531 11.8236ZM4.17643 12.6547L3.46932 13.3618L4.04901 13.9415L4.73113 13.4868L4.17643 12.6547ZM6.17738 11.3207L6.56007 10.3969L6.06686 10.1926L5.62268 10.4887L6.17738 11.3207ZM6.94068 11.6369L7.92126 11.4408L7.81657 10.9173L7.32337 10.713L6.94068 11.6369ZM7.41231 13.9951L6.43173 14.1912L6.59251 14.9951H7.41231V13.9951ZM8.58769 13.9951V14.9951H9.40749L9.56827 14.1912L8.58769 13.9951ZM9.05931 11.6369L8.67661 10.713L8.18343 10.9173L8.07873 11.4408L9.05931 11.6369ZM9.82263 11.3207L10.3773 10.4887L9.93313 10.1925L9.43992 10.3968L9.82263 11.3207ZM11.8236 12.6547L11.2689 13.4867L11.951 13.9415L12.5307 13.3618L11.8236 12.6547ZM12.6547 11.8236L13.3618 12.5307L13.9415 11.951L13.4868 11.2689L12.6547 11.8236ZM11.3207 9.82262L10.3969 9.43994L10.1926 9.93315L10.4887 10.3773L11.3207 9.82262ZM11.6369 9.05932L11.4408 8.07874L10.9173 8.18344L10.713 8.67664L11.6369 9.05932ZM13.995 8.5877L14.1912 9.56828L14.995 9.4075V8.5877H13.995ZM13.995 7.41232H14.995V6.59252L14.1912 6.43174L13.995 7.41232ZM10.8766 3.22641L10.3921 0.803887L8.43097 1.19611L8.91547 3.61864L10.8766 3.22641ZM11.3969 1.22009L9.34135 2.59047L10.4507 4.25457L12.5063 2.88419L11.3969 1.22009ZM14.655 3.34126L12.6587 1.34503L11.2445 2.75925L13.2408 4.75548L14.655 3.34126ZM13.4095 6.65866L14.7799 4.60307L13.1158 3.49367L11.7454 5.54925L13.4095 6.65866ZM15.1961 5.60788L12.7736 5.12337L12.3814 7.08454L14.8039 7.56904L15.1961 5.60788ZM16 9.41156V6.58846H14V9.41156H16ZM12.7736 10.8766L15.1961 10.3921L14.8039 8.43098L12.3814 8.91548L12.7736 10.8766ZM14.7799 11.3969L13.4095 9.34136L11.7454 10.4508L13.1158 12.5063L14.7799 11.3969ZM12.6587 14.655L14.655 12.6587L13.2408 11.2445L11.2445 13.2407L12.6587 14.655ZM9.34136 13.4095L11.3969 14.7799L12.5063 13.1158L10.4508 11.7454L9.34136 13.4095ZM10.3921 15.1961L10.8766 12.7736L8.91548 12.3814L8.43097 14.8039L10.3921 15.1961ZM6.58845 16H9.41155V14H6.58845V16ZM5.12337 12.7736L5.60787 15.1961L7.56903 14.8039L7.08453 12.3814L5.12337 12.7736ZM4.60308 14.7799L6.65865 13.4095L5.54925 11.7454L3.49368 13.1158L4.60308 14.7799ZM1.34504 12.6587L3.34127 14.655L4.75549 13.2408L2.75925 11.2445L1.34504 12.6587ZM2.59048 9.34136L1.22009 11.3969L2.88419 12.5063L4.25458 10.4508L2.59048 9.34136ZM0.803884 10.3921L3.22641 10.8766L3.61865 8.91548L1.19612 8.43098L0.803884 10.3921ZM0 6.58846V9.41156H2V6.58846H0ZM3.22641 5.12338L0.803884 5.60788L1.19612 7.56904L3.61864 7.08454L3.22641 5.12338ZM1.22009 4.60309L2.59047 6.65866L4.25457 5.54926L2.88419 3.49368L1.22009 4.60309ZM3.34127 1.34505L1.34503 3.34128L2.75925 4.75549L4.75548 2.75926L3.34127 1.34505ZM6.65865 2.59049L4.60307 1.2201L3.49367 2.8842L5.54925 4.25459L6.65865 2.59049ZM5.60787 0.803908L5.12337 3.22642L7.08453 3.61865L7.56903 1.19613L5.60787 0.803908ZM9.41154 0L6.58844 2.14739e-05L6.58846 2.00002L9.41156 2L9.41154 0ZM10.3968 6.56005L10.713 7.32337L12.5608 6.55801L12.2446 5.79469L10.3968 6.56005ZM11.8226 3.62172L10.4887 5.62267L12.1528 6.73207L13.4867 4.73112L11.8226 3.62172ZM11.1165 4.05241L11.9476 4.88353L13.3618 3.46931L12.5307 2.6382L11.1165 4.05241ZM10.3773 5.51132L12.3783 4.17735L11.2689 2.51325L9.26793 3.84722L10.3773 5.51132ZM8.67665 5.287L9.43997 5.60316L10.2053 3.75538L9.44197 3.43922L8.67665 5.287ZM7.60711 2.20107L8.07873 4.55923L10.0399 4.167L9.56827 1.80884L7.60711 2.20107ZM7.41232 3.00497L8.5877 3.00496L8.58768 1.00496L7.41231 1.00497L7.41232 3.00497ZM7.92127 4.55924L8.3929 2.20108L6.43173 1.80885L5.96011 4.16702L7.92127 4.55924ZM6.56003 5.60317L7.32335 5.28702L6.55803 3.43924L5.79471 3.75539L6.56003 5.60317ZM3.62172 4.17737L5.62267 5.51133L6.73207 3.84723L4.73112 2.51327L3.62172 4.17737ZM4.05241 4.88354L4.88353 4.05243L3.46932 2.63821L2.6382 3.46933L4.05241 4.88354ZM5.51133 5.62269L4.17736 3.62173L2.51326 4.73113L3.84723 6.73209L5.51133 5.62269ZM5.28697 7.32339L5.60315 6.56009L3.75541 5.79469L3.43922 6.558L5.28697 7.32339ZM2.20107 8.3929L4.55921 7.92128L4.16698 5.96011L1.80884 6.43174L2.20107 8.3929ZM3.00495 8.5877V7.41232H1.00495V8.5877H3.00495ZM4.55921 8.07874L2.20107 7.60712L1.80884 9.56828L4.16698 10.0399L4.55921 8.07874ZM5.60316 9.43993L5.28696 8.67662L3.43922 9.44203L3.75542 10.2053L5.60316 9.43993ZM4.17736 12.3783L5.51134 10.3773L3.84724 9.26793L2.51326 11.2689L4.17736 12.3783ZM4.88353 11.9476L4.05242 11.1165L2.63821 12.5307L3.46932 13.3618L4.88353 11.9476ZM5.62268 10.4887L3.62173 11.8227L4.73113 13.4868L6.73208 12.1528L5.62268 10.4887ZM7.32337 10.713L6.56007 10.3969L5.7947 12.2446L6.558 12.5608L7.32337 10.713ZM8.39289 13.7989L7.92126 11.4408L5.9601 11.833L6.43173 14.1912L8.39289 13.7989ZM8.58769 12.9951H7.41231V14.9951H8.58769V12.9951ZM8.07873 11.4408L7.60711 13.7989L9.56827 14.1912L10.0399 11.833L8.07873 11.4408ZM9.43992 10.3968L8.67661 10.713L9.44202 12.5608L10.2053 12.2446L9.43992 10.3968ZM12.3783 11.8226L10.3773 10.4887L9.26793 12.1528L11.2689 13.4867L12.3783 11.8226ZM11.9476 11.1165L11.1165 11.9476L12.5307 13.3618L13.3618 12.5307L11.9476 11.1165ZM10.4887 10.3773L11.8227 12.3783L13.4868 11.2689L12.1528 9.26792L10.4887 10.3773ZM10.713 8.67664L10.3969 9.43994L12.2446 10.2053L12.5608 9.442L10.713 8.67664ZM13.7989 7.60712L11.4408 8.07874L11.833 10.0399L14.1912 9.56828L13.7989 7.60712ZM12.995 7.41232V8.5877H14.995V7.41232H12.995ZM11.4408 7.92127L13.7989 8.3929L14.1912 6.43174L11.833 5.96011L11.4408 7.92127ZM8 10C9.10457 10 10 9.10457 10 8H8V10ZM6 8C6 9.10457 6.89543 10 8 10V8H6ZM8 6C6.89543 6 6 6.89543 6 8H8V6ZM10 8C10 6.89543 9.10457 6 8 6V8H10ZM8 11C9.65685 11 11 9.65685 11 8H9C9 8.55228 8.55228 9 8 9V11ZM5 8C5 9.65685 6.34315 11 8 11V9C7.44772 9 7 8.55228 7 8H5ZM8 5C6.34315 5 5 6.34315 5 8H7C7 7.44772 7.44772 7 8 7V5ZM11 8C11 6.34315 9.65685 5 8 5V7C8.55228 7 9 7.44772 9 8H11Z" fill="white" mask="url(#path-1-inside-1)"/>
</svg>
......@@ -7,7 +7,10 @@
background-image: url('configure-light.svg');
}
.vs-dark .monaco-workbench .quick-open-task-configure,
.hc-black .monaco-workbench .quick-open-task-configure {
.vs-dark .monaco-workbench .quick-open-task-configure {
background-image: url('configure-dark.svg');
}
.hc-black .monaco-workbench .quick-open-task-configure {
background-image: url('configure-hc.svg');
}
......@@ -222,7 +222,6 @@ import 'vs/workbench/contrib/themes/browser/themes.contribution';
import 'vs/workbench/contrib/watermark/browser/watermark';
// Welcome
import 'vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution';
import 'vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay';
// Call Hierarchy
......
......@@ -136,6 +136,7 @@ import 'vs/workbench/contrib/cli/node/cli.contribution';
import 'vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution';
// Welcome
import 'vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution';
import 'vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.contribution';
import 'vs/workbench/contrib/welcome/page/browser/welcomePage.contribution';
......
.DS_Store
npm-debug.log
Thumbs.db
node_modules/
out/
keybindings.*.json
src/driver.d.ts
# VS Code Automation Package
This package contains functionality for automating various components of the VS Code UI, via an automation "driver" that connects from a separate process. It is used by the `smoke` tests.
{
"name": "vscode-automation",
"version": "1.39.0",
"description": "VS Code UI automation driver",
"author": {
"name": "Microsoft Corporation"
},
"license": "MIT",
"main": "./out/index.js",
"private": true,
"scripts": {
"postinstall": "npm run compile",
"compile": "npm run copy-driver && npm run copy-driver-definition && tsc",
"watch": "concurrently \"npm run watch-driver\" \"npm run watch-driver-definition\" \"tsc --watch\"",
"copy-driver": "cpx src/driver.js out/",
"watch-driver": "cpx src/driver.js out/ -w",
"copy-driver-definition": "node tools/copy-driver-definition.js",
"watch-driver-definition": "watch \"node tools/copy-driver-definition.js\" ../../src/vs/platform/driver/node",
"copy-package-version": "node tools/copy-package-version.js",
"prepublishOnly": "npm run copy-package-version"
},
"devDependencies": {
"@types/mkdirp": "0.5.1",
"@types/ncp": "2.0.1",
"@types/node": "8.0.33",
"@types/puppeteer": "^1.19.0",
"@types/tmp": "0.1.0",
"concurrently": "^3.5.1",
"cpx": "^1.5.0",
"typescript": "2.9.2",
"watch": "^1.0.2"
},
"dependencies": {
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"puppeteer": "^1.19.0",
"tmp": "0.1.0",
"vscode-uri": "^2.0.3"
}
}
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export const enum ActivityBarPosition {
LEFT = 0,
......@@ -27,4 +27,4 @@ export class ActivityBar {
await this.code.waitForElement(`.part.activitybar.${positionClass}`);
}
}
\ No newline at end of file
}
......@@ -5,8 +5,8 @@
import * as fs from 'fs';
import * as path from 'path';
import { Workbench } from './areas/workbench/workbench';
import { Code, spawn, SpawnOptions } from './vscode/code';
import { Workbench } from './workbench';
import { Code, spawn, SpawnOptions } from './code';
import { Logger } from './logger';
export const enum Quality {
......@@ -25,7 +25,7 @@ export interface ApplicationOptions extends SpawnOptions {
export class Application {
private _code: Code | undefined;
private _workbench: Workbench;
private _workbench: Workbench | undefined;
constructor(private options: ApplicationOptions) {
this._workspacePathOrFolder = options.workspacePath;
......@@ -40,7 +40,7 @@ export class Application {
}
get workbench(): Workbench {
return this._workbench;
return this._workbench!;
}
get logger(): Logger {
......
......@@ -11,11 +11,11 @@ import * as mkdirp from 'mkdirp';
import { tmpName } from 'tmp';
import { IDriver, connect as connectElectronDriver, IDisposable, IElement, Thenable } from './driver';
import { connect as connectPuppeteerDriver, launch } from './puppeteerDriver';
import { Logger } from '../logger';
import { Logger } from './logger';
import { ncp } from 'ncp';
import { URI } from 'vscode-uri';
const repoPath = path.join(__dirname, '../../../..');
const repoPath = path.join(__dirname, '../../..');
function getDevElectronPath(): string {
const buildPath = path.join(repoPath, '.build');
......@@ -237,13 +237,14 @@ export class Code {
throw new Error('Invalid usage');
}
if (typeof target[prop] !== 'function') {
return target[prop];
const targetProp = (target as any)[prop];
if (typeof targetProp !== 'function') {
return targetProp;
}
return function (...args) {
return function (this: any, ...args: any[]) {
logger.log(`${prop}`, ...args.filter(a => typeof a === 'string'));
return target[prop].apply(this, args);
return targetProp.apply(this, args);
};
}
});
......
......@@ -3,12 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Viewlet } from '../workbench/viewlet';
import { Commands } from '../workbench/workbench';
import { Code, findElement } from '../../vscode/code';
import { Editors } from '../editor/editors';
import { Editor } from '../editor/editor';
import { IElement } from '../../vscode/driver';
import { Viewlet } from './viewlet';
import { Commands } from './workbench';
import { Code, findElement } from './code';
import { Editors } from './editors';
import { Editor } from './editor';
import { IElement } from '../src/driver';
const VIEWLET = 'div[id="workbench.view.debug"]';
const DEBUG_VIEW = `${VIEWLET} .debug-view-content`;
......@@ -25,7 +25,7 @@ const DEBUG_STATUS_BAR = `.statusbar.debugging`;
const NOT_DEBUG_STATUS_BAR = `.statusbar:not(debugging)`;
const TOOLBAR_HIDDEN = `.debug-toolbar[aria-hidden="true"]`;
const STACK_FRAME = `${VIEWLET} .monaco-list-row .stack-frame`;
const SPECIFIC_STACK_FRAME = filename => `${STACK_FRAME} .file[title*="${filename}"]`;
const SPECIFIC_STACK_FRAME = (filename: string) => `${STACK_FRAME} .file[title*="${filename}"]`;
const VARIABLE = `${VIEWLET} .debug-variables .monaco-list-row .expression`;
const CONSOLE_OUTPUT = `.repl .output.expression .value`;
const CONSOLE_EVALUATION_RESULT = `.repl .evaluation-result.expression .value`;
......
......@@ -4,14 +4,14 @@
*--------------------------------------------------------------------------------------------*/
import { References } from './peek';
import { Commands } from '../workbench/workbench';
import { Code } from '../../vscode/code';
import { Commands } from './workbench';
import { Code } from './code';
const RENAME_BOX = '.monaco-editor .monaco-editor.rename-box';
const RENAME_INPUT = `${RENAME_BOX} .rename-input`;
const EDITOR = filename => `.monaco-editor[data-uri$="${filename}"]`;
const VIEW_LINES = filename => `${EDITOR(filename)} .view-lines`;
const LINE_NUMBERS = filename => `${EDITOR(filename)} .margin .margin-view-overlays .line-numbers`;
const EDITOR = (filename: string) => `.monaco-editor[data-uri$="${filename}"]`;
const VIEW_LINES = (filename: string) => `${EDITOR(filename)} .view-lines`;
const LINE_NUMBERS = (filename: string) => `${EDITOR(filename)} .margin .margin-view-overlays .line-numbers`;
export class Editor {
......@@ -130,4 +130,4 @@ export class Editor {
throw new Error('Line not found');
}
}
\ No newline at end of file
}
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export class Editors {
......@@ -49,4 +49,4 @@ export class Editors {
await this.waitForEditorFocus('Untitled-1', true);
}
}
\ No newline at end of file
}
......@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Viewlet } from '../workbench/viewlet';
import { Editors } from '../editor/editors';
import { Code } from '../../vscode/code';
import { Viewlet } from './viewlet';
import { Editors } from './editors';
import { Code } from './code';
export class Explorer extends Viewlet {
......@@ -45,4 +45,4 @@ export class Explorer extends Viewlet {
throw new Error('No class defined for this file extension');
}
}
\ No newline at end of file
}
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Viewlet } from '../workbench/viewlet';
import { Code } from '../../vscode/code';
import { Viewlet } from './viewlet';
import { Code } from './code';
const SEARCH_BOX = 'div.extensions-viewlet[id="workbench.view.extensions"] .monaco-editor textarea';
......@@ -40,4 +40,4 @@ export class Extensions extends Viewlet {
await this.code.waitAndClick(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="${ariaLabel}"] .extension li[class='action-item'] .extension-action.install`);
await this.code.waitForElement(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action.uninstall`);
}
}
\ No newline at end of file
}
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export * from './activityBar';
export * from './application';
export * from './code';
export * from './debug';
export * from './editor';
export * from './editors';
export * from './explorer';
export * from './extensions';
export * from './keybindings';
export * from './logger';
export * from './peek';
export * from './problems';
export * from './quickinput';
export * from './quickopen';
export * from './scm';
export * from './search';
export * from './settings';
export * from './statusbar';
export * from './terminal';
export * from './viewlet';
export * from './workbench';
export * from '../src/driver';
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
const SEARCH_INPUT = '.keybindings-header .settings-search-input input';
......@@ -31,4 +31,4 @@ export class KeybindingsEditor {
await this.code.dispatchKeybinding('enter');
await this.code.waitForElement(`.keybindings-list-container div[aria-label="Keybinding is ${ariaLabel}."]`);
}
}
\ No newline at end of file
}
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export class References {
......
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export const enum ProblemSeverity {
WARNING = 0,
......
......@@ -8,11 +8,12 @@ import { ChildProcess, spawn } from 'child_process';
import { join } from 'path';
import { mkdir } from 'fs';
import { promisify } from 'util';
import { IDriver, IDisposable } from './driver';
const width = 1200;
const height = 800;
const vscodeToPuppeteerKey = {
const vscodeToPuppeteerKey: { [key: string]: string } = {
cmd: 'Meta',
ctrl: 'Control',
shift: 'Shift',
......@@ -111,7 +112,7 @@ function teardown(): void {
function waitForEndpoint(): Promise<string> {
return new Promise<string>(r => {
server!.stdout.on('data', d => {
server!.stdout.on('data', (d: Buffer) => {
const matches = d.toString('ascii').match(/Web UI available at (.+)/);
if (matches !== null) {
r(matches[1]);
......@@ -139,54 +140,3 @@ export function connect(headless: boolean, outPath: string, handle: string): Pro
c(result);
});
}
/**
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
* and others. This API makes no assumption about what promise library is being used which
* enables reusing existing code without migrating to a specific promise implementation. Still,
* we recommend the use of native promises which are available in this editor.
*/
export interface Thenable<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
}
export interface IElement {
tagName: string;
className: string;
textContent: string;
attributes: { [name: string]: string; };
children: IElement[];
top: number;
left: number;
}
export interface IDriver {
_serviceBrand: undefined;
getWindowIds(): Promise<number[]>;
capturePage(windowId: number): Promise<string>;
reloadWindow(windowId: number): Promise<void>;
exitApplication(): Promise<void>;
dispatchKeybinding(windowId: number, keybinding: string): Promise<void>;
click(windowId: number, selector: string, xoffset?: number | undefined, yoffset?: number | undefined): Promise<void>;
doubleClick(windowId: number, selector: string): Promise<void>;
setValue(windowId: number, selector: string, text: string): Promise<void>;
getTitle(windowId: number): Promise<string>;
isActiveElement(windowId: number, selector: string): Promise<boolean>;
getElements(windowId: number, selector: string, recursive?: boolean): Promise<IElement[]>;
getElementXY(windowId: number, selector: string, xoffset?: number, yoffset?: number): Promise<{ x: number; y: number; }>;
typeInEditor(windowId: number, selector: string, text: string): Promise<void>;
getTerminalBuffer(windowId: number, selector: string): Promise<string[]>;
writeInTerminal(windowId: number, selector: string, text: string): Promise<void>;
}
export interface IDisposable {
dispose(): void;
}
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export class QuickInput {
......
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Editors } from '../editor/editors';
import { Code } from '../../vscode/code';
import { Editors } from './editors';
import { Code } from './code';
export class QuickOpen {
......
......@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Viewlet } from '../workbench/viewlet';
import { IElement } from '../../vscode/driver';
import { findElement, findElements, Code } from '../../vscode/code';
import { Viewlet } from './viewlet';
import { IElement } from '../src/driver';
import { findElement, findElements, Code } from './code';
const VIEWLET = 'div[id="workbench.view.scm"]';
const SCM_INPUT = `${VIEWLET} .scm-editor textarea`;
......@@ -76,4 +76,4 @@ export class SCM extends Viewlet {
await this.code.waitForSetValue(SCM_INPUT, message);
await this.code.waitAndClick(COMMIT_COMMAND);
}
}
\ No newline at end of file
}
......@@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Viewlet } from '../workbench/viewlet';
import { Code } from '../../vscode/code';
import { Viewlet } from './viewlet';
import { Code } from './code';
const VIEWLET = '.search-view';
const INPUT = `${VIEWLET} .search-widget .search-container .monaco-inputbox textarea`;
const INCLUDE_INPUT = `${VIEWLET} .query-details .file-types.includes .monaco-inputbox input`;
const FILE_MATCH = filename => `${VIEWLET} .results .filematch[data-resource$="${filename}"]`;
const FILE_MATCH = (filename: string) => `${VIEWLET} .results .filematch[data-resource$="${filename}"]`;
async function retry(setup: () => Promise<any>, attempt: () => Promise<any>) {
let count = 0;
......
......@@ -5,15 +5,10 @@
import * as fs from 'fs';
import * as path from 'path';
import { Editor } from '../editor/editor';
import { Editors } from '../editor/editors';
import { Code } from '../../vscode/code';
import { QuickOpen } from '../quickopen/quickopen';
export const enum ActivityBarPosition {
LEFT = 0,
RIGHT = 1
}
import { Editor } from './editor';
import { Editors } from './editors';
import { Code } from './code';
import { QuickOpen } from './quickopen';
export class SettingsEditor {
......
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export const enum StatusBarElement {
BRANCH_STATUS = 0,
......
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { QuickOpen } from '../quickopen/quickopen';
import { Code } from './code';
import { QuickOpen } from './quickopen';
const PANEL_SELECTOR = 'div[id="workbench.panel.terminal"]';
const XTERM_SELECTOR = `${PANEL_SELECTOR} .terminal-wrapper`;
......@@ -30,4 +30,4 @@ export class Terminal {
async waitForTerminalText(accept: (buffer: string[]) => boolean): Promise<void> {
await this.code.waitForTerminalBuffer(XTERM_SELECTOR, accept);
}
}
\ No newline at end of file
}
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../../vscode/code';
import { Code } from './code';
export abstract class Viewlet {
......@@ -12,4 +12,4 @@ export abstract class Viewlet {
async waitForTitle(fn: (title: string) => boolean): Promise<void> {
await this.code.waitForTextContent('.monaco-workbench .part.sidebar > .title > .title-label > h2', undefined, fn);
}
}
\ No newline at end of file
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册