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", "version": "0.0.1",
"description": "Dependencies shared by all extensions", "description": "Dependencies shared by all extensions",
"dependencies": { "dependencies": {
"typescript": "3.4.3" "typescript": "3.4.4"
}, },
"scripts": { "scripts": {
"postinstall": "node ./postinstall" "postinstall": "node ./postinstall"

View File

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

View File

@@ -6,7 +6,7 @@
import 'vs/css!./dialog'; import 'vs/css!./dialog';
import * as nls from 'vs/nls'; import * as nls from 'vs/nls';
import { Disposable } from 'vs/base/common/lifecycle'; 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 { domEvent } from 'vs/base/browser/event';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
@@ -39,6 +39,8 @@ export class Dialog extends Disposable {
private toolbarContainer: HTMLElement | undefined; private toolbarContainer: HTMLElement | undefined;
private buttonGroup: ButtonGroup | undefined; private buttonGroup: ButtonGroup | undefined;
private styles: IDialogStyles | 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) { constructor(private container: HTMLElement, private message: string, private buttons: string[], private options: IDialogOptions) {
super(); super();
@@ -72,6 +74,8 @@ export class Dialog extends Disposable {
} }
async show(): Promise<number> { async show(): Promise<number> {
this.focusToReturn = document.activeElement as HTMLElement;
return new Promise<number>((resolve) => { return new Promise<number>((resolve) => {
if (!this.element || !this.buttonsContainer || !this.iconElement || !this.toolbarContainer) { if (!this.element || !this.buttonsContainer || !this.iconElement || !this.toolbarContainer) {
resolve(0); 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'); removeClasses(this.iconElement, 'icon-error', 'icon-warning', 'icon-info');
switch (this.options.type) { switch (this.options.type) {
@@ -146,6 +163,15 @@ export class Dialog extends Disposable {
break; break;
case 'pending': case 'pending':
addClass(this.iconElement, 'icon-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; break;
case 'none': case 'none':
case 'info': case 'info':
@@ -206,5 +232,14 @@ export class Dialog extends Disposable {
removeNode(this.modal); removeNode(this.modal);
this.modal = undefined; 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' ?> <?xml version='1.0' standalone='no' ?>
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='10px' height='10px'> <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;"> <g style="fill:grey;">
<circle cx='5' cy='1' 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.3;' /> <circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.9;' />
<circle cx='9' cy='5' r='1' style='opacity:0.3;' /> <circle cx='9' cy='5' r='1' style='opacity:0.8;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.3;' /> <circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.7;' />
<circle cx='5' cy='9' r='1' style='opacity:0.3;' /> <circle cx='5' cy='9' r='1' style='opacity:0.6;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.3;' /> <circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.5;' />
<circle cx='1' cy='5' r='1' style='opacity:0.3;' /> <circle cx='1' cy='5' r='1' style='opacity:0.4;' />
<circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' /> <circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' />
</g> </g>
</svg> </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' ?> <?xml version='1.0' standalone='no' ?>
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='10px' height='10px'> <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;"> <g style="fill:white;">
<circle cx='5' cy='1' 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.3;' /> <circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.9;' />
<circle cx='9' cy='5' r='1' style='opacity:0.3;' /> <circle cx='9' cy='5' r='1' style='opacity:0.8;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.3;' /> <circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.7;' />
<circle cx='5' cy='9' r='1' style='opacity:0.3;' /> <circle cx='5' cy='9' r='1' style='opacity:0.6;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.3;' /> <circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.5;' />
<circle cx='1' cy='5' r='1' style='opacity:0.3;' /> <circle cx='1' cy='5' r='1' style='opacity:0.4;' />
<circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' /> <circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' />
</g> </g>
</svg> </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' ?> <?xml version='1.0' standalone='no' ?>
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='10px' height='10px'> <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> <g>
<circle cx='5' cy='1' 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.3;' /> <circle cx='7.8284' cy='2.1716' r='1' style='opacity:0.9;' />
<circle cx='9' cy='5' r='1' style='opacity:0.3;' /> <circle cx='9' cy='5' r='1' style='opacity:0.8;' />
<circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.3;' /> <circle cx='7.8284' cy='7.8284' r='1' style='opacity:0.7;' />
<circle cx='5' cy='9' r='1' style='opacity:0.3;' /> <circle cx='5' cy='9' r='1' style='opacity:0.6;' />
<circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.3;' /> <circle cx='2.1716' cy='7.8284' r='1' style='opacity:0.5;' />
<circle cx='1' cy='5' r='1' style='opacity:0.3;' /> <circle cx='1' cy='5' r='1' style='opacity:0.4;' />
<circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' /> <circle cx='2.1716' cy='2.1716' r='1' style='opacity:0.3;' />
</g> </g>
</svg> </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); label.textContent = nls.localize('largeImageError', "The image is not displayed in the editor because it is too large ({0}).", size);
container.appendChild(label); container.appendChild(label);
if (descriptor.resource.scheme !== Schemas.data) { if (descriptor.resource.scheme === Schemas.file) {
const link = DOM.append(label, DOM.$('a.embedded-link')); const link = DOM.append(label, DOM.$('a.embedded-link'));
link.setAttribute('role', 'button'); link.setAttribute('role', 'button');
link.textContent = nls.localize('resourceOpenExternalButton', "Open image using external program?"); 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 { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { SettingsTarget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; import { SettingsTarget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets';
import { ITOCEntry, knownAcronyms } from 'vs/workbench/contrib/preferences/browser/settingsLayout'; 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 { 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'; export const ONLINE_SERVICES_SETTING_TAG = 'usesOnlineServices';
@@ -142,11 +142,15 @@ export class SettingsTreeSettingElement extends SettingsTreeElement {
const displayValue = isConfigured ? inspected[targetSelector] : inspected.default; const displayValue = isConfigured ? inspected[targetSelector] : inspected.default;
const overriddenScopeList: string[] = []; const overriddenScopeList: string[] = [];
if (targetSelector === 'user' && typeof inspected.workspace !== 'undefined') { if (targetSelector !== 'workspace' && typeof inspected.workspace !== 'undefined') {
overriddenScopeList.push(localize('workspace', "Workspace")); 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")); overriddenScopeList.push(localize('user', "User"));
} }
@@ -354,8 +358,17 @@ export class SettingsTreeModel {
interface IInspectResult { interface IInspectResult {
isConfigured: boolean; isConfigured: boolean;
inspected: any; inspected: {
targetSelector: string; 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 { 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 { URI } from 'vs/base/common/uri';
import 'vs/css!./media/settingsEditor2'; import 'vs/css!./media/settingsEditor2';
import { localize } from 'vs/nls'; 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 { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; 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 { 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 { settingsTextInputBorder } from 'vs/workbench/contrib/preferences/browser/settingsWidgets';
import { createTOCIterator, TOCTree, TOCTreeModel } from 'vs/workbench/contrib/preferences/browser/tocTree'; 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 { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
@@ -210,23 +210,23 @@ export class SettingsEditor2 extends BaseEditor {
return super.setInput(input, options, token) return super.setInput(input, options, token)
.then(() => new Promise(process.nextTick)) // Force setInput to be async .then(() => new Promise(process.nextTick)) // Force setInput to be async
.then(() => { .then(() => {
if (!options) { return this.render(token);
})
.then(() => {
if (!this.viewState.settingsTarget) { if (!this.viewState.settingsTarget) {
// Persist? if (!options) {
options = SettingsEditorOptions.create({ target: ConfigurationTarget.USER_LOCAL }); options = SettingsEditorOptions.create({ target: ConfigurationTarget.USER_LOCAL });
}
} else if (!options.target) { } else if (!options.target) {
options.target = ConfigurationTarget.USER_LOCAL; options.target = ConfigurationTarget.USER_LOCAL;
} }
}
this._setOptions(options); this._setOptions(options);
this._register(input.onDispose(() => { this._register(input.onDispose(() => {
this.searchWidget.setValue(''); this.searchWidget.setValue('');
})); }));
return this.render(token);
})
.then(() => {
// Init TOC selection // Init TOC selection
this.updateTreeScrollSync(); this.updateTreeScrollSync();
@@ -255,18 +255,16 @@ export class SettingsEditor2 extends BaseEditor {
} }
private _setOptions(options: SettingsEditorOptions): void { private _setOptions(options: SettingsEditorOptions): void {
if (!options) {
return;
}
if (options.query) { if (options.query) {
this.searchWidget.setValue(options.query); this.searchWidget.setValue(options.query);
} }
const target: SettingsTarget = options.folderUri || <SettingsTarget>options.target; const target: SettingsTarget = options.folderUri || <SettingsTarget>options.target;
if (target) {
this.settingsTargetsWidget.settingsTarget = target; this.settingsTargetsWidget.settingsTarget = target;
this.viewState.settingsTarget = target; this.viewState.settingsTarget = target;
} }
}
clearInput(): void { clearInput(): void {
this.inSettingsEditorContextKey.set(false); this.inSettingsEditorContextKey.set(false);
@@ -616,11 +614,11 @@ export class SettingsEditor2 extends BaseEditor {
this.settingsTree.reveal(element); this.settingsTree.reveal(element);
})); }));
this._register(this.settingRenderers.onDidClickOverrideElement((element: ISettingOverrideClickEvent) => { this._register(this.settingRenderers.onDidClickOverrideElement((element: ISettingOverrideClickEvent) => {
if (ConfigurationTargetToString(ConfigurationTarget.WORKSPACE) === element.scope.toUpperCase()) { if (element.scope.toLowerCase() === 'workspace') {
this.settingsTargetsWidget.updateTarget(ConfigurationTarget.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); 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); this.settingsTargetsWidget.updateTarget(ConfigurationTarget.USER_REMOTE);
} }
@@ -1219,11 +1217,14 @@ export class SettingsEditor2 extends BaseEditor {
} }
private renderResultCountMessages() { private renderResultCountMessages() {
if (!this.currentSettingsModel || !this.searchResultModel) { if (!this.currentSettingsModel) {
this.countElement.style.display = 'none';
return; return;
} }
if (!this.searchResultModel) {
this.countElement.style.display = 'none';
}
if (this.tocTreeModel && this.tocTreeModel.settingsTreeRoot) { if (this.tocTreeModel && this.tocTreeModel.settingsTreeRoot) {
const count = this.tocTreeModel.settingsTreeRoot.count; const count = this.tocTreeModel.settingsTreeRoot.count;
switch (count) { switch (count) {

View File

@@ -260,7 +260,7 @@ configurationRegistry.registerConfiguration({
default: 'inherited' default: 'inherited'
}, },
'terminal.integrated.windowsEnableConpty': { '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', type: 'boolean',
default: true 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); 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)); 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); const computedStyle = window.getComputedStyle(this._container);

View File

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

View File

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

View File

@@ -51,7 +51,15 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
} }
this._initialCwd = cwd; 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 = { const options: pty.IPtyForkOptions = {
name: shellName, name: shellName,
cwd, cwd,

View File

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