Merge from vscode 2b87545500dbc7899a493d69199aa4e061414ea0 (#5148)

This commit is contained in:
Anthony Dresser
2019-04-22 16:57:13 -07:00
committed by GitHub
parent 1b24dff738
commit 5e62229f25
15 changed files with 139 additions and 115 deletions

View File

@@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "3.4.3"
"typescript": "3.4.4"
},
"scripts": {
"postinstall": "node ./postinstall"

View File

@@ -2,7 +2,7 @@
# yarn lockfile v1
typescript@3.4.3:
version "3.4.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.3.tgz#0eb320e4ace9b10eadf5bc6103286b0f8b7c224f"
integrity sha512-FFgHdPt4T/duxx6Ndf7hwgMZZjZpB+U0nMNGVCYPq0rEzWKjEDobm4J6yb3CS7naZ0yURFqdw9Gwc7UOh/P9oQ==
typescript@3.4.4:
version "3.4.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.4.tgz#aac4a08abecab8091a75f10842ffa0631818f785"
integrity sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==

View File

@@ -6,7 +6,7 @@
import 'vs/css!./dialog';
import * as nls from 'vs/nls';
import { Disposable } from 'vs/base/common/lifecycle';
import { $, hide, show, EventHelper, clearNode, removeClasses, addClass, removeNode } from 'vs/base/browser/dom';
import { $, hide, show, EventHelper, clearNode, removeClasses, addClass, removeNode, isAncestor } from 'vs/base/browser/dom';
import { domEvent } from 'vs/base/browser/event';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
@@ -39,6 +39,8 @@ export class Dialog extends Disposable {
private toolbarContainer: HTMLElement | undefined;
private buttonGroup: ButtonGroup | undefined;
private styles: IDialogStyles | undefined;
private focusToReturn: HTMLElement | undefined;
private iconRotatingInternal: any | undefined;
constructor(private container: HTMLElement, private message: string, private buttons: string[], private options: IDialogOptions) {
super();
@@ -72,6 +74,8 @@ export class Dialog extends Disposable {
}
async show(): Promise<number> {
this.focusToReturn = document.activeElement as HTMLElement;
return new Promise<number>((resolve) => {
if (!this.element || !this.buttonsContainer || !this.iconElement || !this.toolbarContainer) {
resolve(0);
@@ -135,6 +139,19 @@ export class Dialog extends Disposable {
}
}));
this._register(domEvent(this.element, 'focusout', false)((e: FocusEvent) => {
if (!!e.relatedTarget && !!this.element) {
if (!isAncestor(e.relatedTarget as HTMLElement, this.element)) {
this.focusToReturn = e.relatedTarget as HTMLElement;
if (e.target) {
(e.target as HTMLElement).focus();
EventHelper.stop(e, true);
}
}
}
}));
removeClasses(this.iconElement, 'icon-error', 'icon-warning', 'icon-info');
switch (this.options.type) {
@@ -146,6 +163,15 @@ export class Dialog extends Disposable {
break;
case 'pending':
addClass(this.iconElement, 'icon-pending');
let deg = 0;
this.iconRotatingInternal = setInterval(() => {
if (this.iconElement) {
this.iconElement.style.transform = `rotate(${deg}deg)`;
deg += 45; // 360 / 8
} else {
this.iconRotatingInternal = undefined;
}
}, 125 /** 1000 / 8 */);
break;
case 'none':
case 'info':
@@ -206,5 +232,14 @@ export class Dialog extends Disposable {
removeNode(this.modal);
this.modal = undefined;
}
if (this.iconRotatingInternal) {
this.iconRotatingInternal = undefined;
}
if (this.focusToReturn && isAncestor(this.focusToReturn, document.body)) {
this.focusToReturn.focus();
this.focusToReturn = undefined;
}
}
}

View File

@@ -1,31 +1,13 @@
<?xml version='1.0' standalone='no' ?>
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='10px' height='10px'>
<style>
circle {
animation: ball 1.04s linear infinite;
}
circle:nth-child(2) { animation-delay: 0.13s; }
circle:nth-child(3) { animation-delay: 0.26s; }
circle:nth-child(4) { animation-delay: 0.39s; }
circle:nth-child(5) { animation-delay: 0.52s; }
circle:nth-child(6) { animation-delay: 0.65s; }
circle:nth-child(7) { animation-delay: 0.78s; }
circle:nth-child(8) { animation-delay: 0.91s; }
@keyframes ball {
from { opacity: 1; }
to { opacity: 0.3; }
}
</style>
<g style="fill:grey;">
<circle cx='5' cy='1' r='1' style='opacity:0.3;' />
<circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.3;' />
<circle cx='9' cy='5' r='1' style='opacity:0.3;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.3;' />
<circle cx='5' cy='9' r='1' style='opacity:0.3;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.3;' />
<circle cx='1' cy='5' r='1' style='opacity:0.3;' />
<circle cx='5' cy='1' r='1' style='opacity: 1.0;' />
<circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.9;' />
<circle cx='9' cy='5' r='1' style='opacity:0.8;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.7;' />
<circle cx='5' cy='9' r='1' style='opacity:0.6;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.5;' />
<circle cx='1' cy='5' r='1' style='opacity:0.4;' />
<circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 631 B

View File

@@ -1,31 +1,13 @@
<?xml version='1.0' standalone='no' ?>
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='10px' height='10px'>
<style>
circle {
animation: ball 1.04s linear infinite;
}
circle:nth-child(2) { animation-delay: 0.13s; }
circle:nth-child(3) { animation-delay: 0.26s; }
circle:nth-child(4) { animation-delay: 0.39s; }
circle:nth-child(5) { animation-delay: 0.52s; }
circle:nth-child(6) { animation-delay: 0.65s; }
circle:nth-child(7) { animation-delay: 0.78s; }
circle:nth-child(8) { animation-delay: 0.91s; }
@keyframes ball {
from { opacity: 1; }
to { opacity: 0.3; }
}
</style>
<g style="fill:white;">
<circle cx='5' cy='1' r='1' style='opacity:0.3;' />
<circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.3;' />
<circle cx='9' cy='5' r='1' style='opacity:0.3;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.3;' />
<circle cx='5' cy='9' r='1' style='opacity:0.3;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.3;' />
<circle cx='1' cy='5' r='1' style='opacity:0.3;' />
<circle cx='5' cy='1' r='1' style='opacity: 1.0;' />
<circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.9;' />
<circle cx='9' cy='5' r='1' style='opacity:0.8;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.7;' />
<circle cx='5' cy='9' r='1' style='opacity:0.6;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.5;' />
<circle cx='1' cy='5' r='1' style='opacity:0.4;' />
<circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 632 B

View File

@@ -1,31 +1,13 @@
<?xml version='1.0' standalone='no' ?>
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='10px' height='10px'>
<style>
circle {
animation: ball 1.04s linear infinite;
}
circle:nth-child(2) { animation-delay: 0.13s; }
circle:nth-child(3) { animation-delay: 0.26s; }
circle:nth-child(4) { animation-delay: 0.39s; }
circle:nth-child(5) { animation-delay: 0.52s; }
circle:nth-child(6) { animation-delay: 0.65s; }
circle:nth-child(7) { animation-delay: 0.78s; }
circle:nth-child(8) { animation-delay: 0.91s; }
@keyframes ball {
from { opacity: 1; }
to { opacity: 0.3; }
}
</style>
<g>
<circle cx='5' cy='1' r='1' style='opacity:0.3;' />
<circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.3;' />
<circle cx='9' cy='5' r='1' style='opacity:0.3;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.3;' />
<circle cx='5' cy='9' r='1' style='opacity:0.3;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.3;' />
<circle cx='1' cy='5' r='1' style='opacity:0.3;' />
<circle cx='5' cy='1' r='1' style='opacity: 1.0;' />
<circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.9;' />
<circle cx='9' cy='5' r='1' style='opacity:0.8;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.7;' />
<circle cx='5' cy='9' r='1' style='opacity:0.6;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.5;' />
<circle cx='1' cy='5' r='1' style='opacity:0.4;' />
<circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 612 B

View File

@@ -164,7 +164,7 @@ class LargeImageView {
label.textContent = nls.localize('largeImageError', "The image is not displayed in the editor because it is too large ({0}).", size);
container.appendChild(label);
if (descriptor.resource.scheme !== Schemas.data) {
if (descriptor.resource.scheme === Schemas.file) {
const link = DOM.append(label, DOM.$('a.embedded-link'));
link.setAttribute('role', 'button');
link.textContent = nls.localize('resourceOpenExternalButton', "Open image using external program?");

View File

@@ -12,8 +12,8 @@ import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configur
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { SettingsTarget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets';
import { ITOCEntry, knownAcronyms } from 'vs/workbench/contrib/preferences/browser/settingsLayout';
import { IExtensionSetting, ISearchResult, ISetting, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
import { MODIFIED_SETTING_TAG } from 'vs/workbench/contrib/preferences/common/preferences';
import { IExtensionSetting, ISearchResult, ISetting, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
export const ONLINE_SERVICES_SETTING_TAG = 'usesOnlineServices';
@@ -142,11 +142,15 @@ export class SettingsTreeSettingElement extends SettingsTreeElement {
const displayValue = isConfigured ? inspected[targetSelector] : inspected.default;
const overriddenScopeList: string[] = [];
if (targetSelector === 'user' && typeof inspected.workspace !== 'undefined') {
if (targetSelector !== 'workspace' && typeof inspected.workspace !== 'undefined') {
overriddenScopeList.push(localize('workspace', "Workspace"));
}
if (targetSelector === 'workspace' && typeof inspected.user !== 'undefined') {
if (targetSelector !== 'userRemote' && typeof inspected.userRemote !== 'undefined') {
overriddenScopeList.push(localize('remote', "Remote"));
}
if (targetSelector !== 'userLocal' && typeof inspected.userLocal !== 'undefined') {
overriddenScopeList.push(localize('user', "User"));
}
@@ -354,8 +358,17 @@ export class SettingsTreeModel {
interface IInspectResult {
isConfigured: boolean;
inspected: any;
targetSelector: string;
inspected: {
default: any,
user: any,
userLocal?: any,
userRemote?: any,
workspace?: any,
workspaceFolder?: any,
memory?: any,
value: any,
};
targetSelector: 'userLocal' | 'userRemote' | 'workspace' | 'workspaceFolder';
}
function inspectSetting(key: string, target: SettingsTarget, configurationService: IConfigurationService): IInspectResult {

View File

@@ -16,7 +16,7 @@ import { isArray, withNullAsUndefined } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
import 'vs/css!./media/settingsEditor2';
import { localize } from 'vs/nls';
import { ConfigurationTarget, ConfigurationTargetToString, IConfigurationOverrides, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ConfigurationTarget, IConfigurationOverrides, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
@@ -36,7 +36,7 @@ import { AbstractSettingRenderer, ISettingLinkClickEvent, ISettingOverrideClickE
import { ISettingsEditorViewState, parseQuery, SearchResultIdx, SearchResultModel, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeModel, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels';
import { settingsTextInputBorder } from 'vs/workbench/contrib/preferences/browser/settingsWidgets';
import { createTOCIterator, TOCTree, TOCTreeModel } from 'vs/workbench/contrib/preferences/browser/tocTree';
import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IPreferencesSearchService, ISearchProvider, MODIFIED_SETTING_TAG, EXTENSION_SETTING_TAG, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences';
import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, EXTENSION_SETTING_TAG, IPreferencesSearchService, ISearchProvider, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
@@ -210,23 +210,23 @@ export class SettingsEditor2 extends BaseEditor {
return super.setInput(input, options, token)
.then(() => new Promise(process.nextTick)) // Force setInput to be async
.then(() => {
if (!options) {
if (!this.viewState.settingsTarget) {
// Persist?
return this.render(token);
})
.then(() => {
if (!this.viewState.settingsTarget) {
if (!options) {
options = SettingsEditorOptions.create({ target: ConfigurationTarget.USER_LOCAL });
} else if (!options.target) {
options.target = ConfigurationTarget.USER_LOCAL;
}
} else if (!options.target) {
options.target = ConfigurationTarget.USER_LOCAL;
}
this._setOptions(options);
this._register(input.onDispose(() => {
this.searchWidget.setValue('');
}));
return this.render(token);
})
.then(() => {
// Init TOC selection
this.updateTreeScrollSync();
@@ -255,17 +255,15 @@ export class SettingsEditor2 extends BaseEditor {
}
private _setOptions(options: SettingsEditorOptions): void {
if (!options) {
return;
}
if (options.query) {
this.searchWidget.setValue(options.query);
}
const target: SettingsTarget = options.folderUri || <SettingsTarget>options.target;
this.settingsTargetsWidget.settingsTarget = target;
this.viewState.settingsTarget = target;
if (target) {
this.settingsTargetsWidget.settingsTarget = target;
this.viewState.settingsTarget = target;
}
}
clearInput(): void {
@@ -616,11 +614,11 @@ export class SettingsEditor2 extends BaseEditor {
this.settingsTree.reveal(element);
}));
this._register(this.settingRenderers.onDidClickOverrideElement((element: ISettingOverrideClickEvent) => {
if (ConfigurationTargetToString(ConfigurationTarget.WORKSPACE) === element.scope.toUpperCase()) {
if (element.scope.toLowerCase() === 'workspace') {
this.settingsTargetsWidget.updateTarget(ConfigurationTarget.WORKSPACE);
} else if (ConfigurationTargetToString(ConfigurationTarget.USER_LOCAL) === element.scope.toUpperCase()) {
} else if (element.scope.toLowerCase() === 'user') {
this.settingsTargetsWidget.updateTarget(ConfigurationTarget.USER_LOCAL);
} else if (ConfigurationTargetToString(ConfigurationTarget.USER_REMOTE) === element.scope.toUpperCase()) {
} else if (element.scope.toLowerCase() === 'remote') {
this.settingsTargetsWidget.updateTarget(ConfigurationTarget.USER_REMOTE);
}
@@ -1219,11 +1217,14 @@ export class SettingsEditor2 extends BaseEditor {
}
private renderResultCountMessages() {
if (!this.currentSettingsModel || !this.searchResultModel) {
this.countElement.style.display = 'none';
if (!this.currentSettingsModel) {
return;
}
if (!this.searchResultModel) {
this.countElement.style.display = 'none';
}
if (this.tocTreeModel && this.tocTreeModel.settingsTreeRoot) {
const count = this.tocTreeModel.settingsTreeRoot.count;
switch (count) {

View File

@@ -260,7 +260,7 @@ configurationRegistry.registerConfiguration({
default: 'inherited'
},
'terminal.integrated.windowsEnableConpty': {
description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication (requires Windows 10 build number 18309+). Winpty will be used if this is false."),
description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication. Winpty will be used if this is false. Note that ConPTY will be disabled regardless of this setting when the Windows 10 build number is lower than 18309 or when you're running the 32-bit VS Code client under 64-bit Windows."),
type: 'boolean',
default: true
},

View File

@@ -443,6 +443,8 @@ export class TerminalInstance implements ITerminalInstance {
}
this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, platform.platform, this._processManager);
});
} else if (this.shellLaunchConfig.isRendererOnly) {
this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, undefined, undefined);
}
this._xterm.on('focus', () => this._onFocus.fire(this));
@@ -600,6 +602,9 @@ export class TerminalInstance implements ITerminalInstance {
});
}
});
} else if (this._shellLaunchConfig.isRendererOnly) {
this._widgetManager = new TerminalWidgetManager(this._wrapperElement);
this._linkHandler.setWidgetManager(this._widgetManager);
}
const computedStyle = window.getComputedStyle(this._container);

View File

@@ -74,8 +74,8 @@ export class TerminalLinkHandler {
constructor(
private _xterm: any,
private _platform: platform.Platform,
private readonly _processManager: ITerminalProcessManager,
private _platform: platform.Platform | undefined,
private readonly _processManager: ITerminalProcessManager | undefined,
@IOpenerService private readonly _openerService: IOpenerService,
@IEditorService private readonly _editorService: IEditorService,
@IConfigurationService private readonly _configurationService: IConfigurationService,
@@ -97,8 +97,10 @@ export class TerminalLinkHandler {
};
this.registerWebLinkHandler();
this.registerLocalLinkHandler();
this.registerGitDiffLinkHandlers();
if (this._platform) {
this.registerLocalLinkHandler();
this.registerGitDiffLinkHandlers();
}
}
public setWidgetManager(widgetManager: TerminalWidgetManager): void {
@@ -186,6 +188,9 @@ export class TerminalLinkHandler {
}
protected get _localLinkRegex(): RegExp {
if (!this._processManager) {
throw new Error('Process manager is required');
}
const baseLocalLinkClause = this._processManager.os === platform.OperatingSystem.Windows ? winLocalLinkClause : unixLocalLinkClause;
// Append line and column number regex
return new RegExp(`${baseLocalLinkClause}(${lineAndColumnClause})`);
@@ -246,6 +251,9 @@ export class TerminalLinkHandler {
}
private get osPath(): IPath {
if (!this._processManager) {
throw new Error('Process manager is required');
}
if (this._processManager.os === platform.OperatingSystem.Windows) {
return win32;
}
@@ -253,6 +261,9 @@ export class TerminalLinkHandler {
}
protected _preprocessPath(link: string): string | null {
if (!this._processManager) {
throw new Error('Process manager is required');
}
if (link.charAt(0) === '~') {
// Resolve ~ -> userHome
if (!this._processManager.userHome) {
@@ -283,6 +294,10 @@ export class TerminalLinkHandler {
}
private _resolvePath(link: string): PromiseLike<URI | null> {
if (!this._processManager) {
throw new Error('Process manager is required');
}
const preprocessedLink = this._preprocessPath(link);
if (!preprocessedLink) {
return Promise.resolve(null);

View File

@@ -72,7 +72,7 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
}
public emitTitle(title: string): void {
// hasReceivedResponse = true;
hasReceivedResponse = true;
this._onProcessTitleChanged.fire(title);
}

View File

@@ -51,7 +51,15 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
}
this._initialCwd = cwd;
const useConpty = windowsEnableConpty && process.platform === 'win32' && getWindowsBuildNumber() >= 18309;
// Only use ConPTY when the client is non WoW64 (see #72190) and the Windows build number is at least 18309 (for
// stability/performance reasons)
const is32ProcessOn64Windows = process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432');
const useConpty = windowsEnableConpty &&
process.platform === 'win32' &&
!is32ProcessOn64Windows &&
getWindowsBuildNumber() >= 18309;
const options: pty.IPtyForkOptions = {
name: shellName,
cwd,

View File

@@ -214,6 +214,7 @@ export interface IPreferencesService {
export function getSettingsTargetName(target: ConfigurationTarget, resource: URI, workspaceContextService: IWorkspaceContextService): string {
switch (target) {
case ConfigurationTarget.USER:
case ConfigurationTarget.USER_LOCAL:
return localize('userSettingsTarget', "User Settings");
case ConfigurationTarget.WORKSPACE: