mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 2b87545500dbc7899a493d69199aa4e061414ea0 (#5148)
This commit is contained in:
@@ -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?");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -72,7 +72,7 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
|
||||
}
|
||||
|
||||
public emitTitle(title: string): void {
|
||||
// hasReceivedResponse = true;
|
||||
hasReceivedResponse = true;
|
||||
this._onProcessTitleChanged.fire(title);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user