mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 09:10:30 -04:00
Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25 (#7929)
* Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25 * fix launch script * add missing files
This commit is contained in:
@@ -289,6 +289,13 @@ export class DebugService implements IDebugService {
|
||||
throw new Error(nls.localize({ key: 'compoundMustHaveConfigurations', comment: ['compound indicates a "compounds" configuration item', '"configurations" is an attribute and should not be localized'] },
|
||||
"Compound must have \"configurations\" attribute set in order to start multiple configurations."));
|
||||
}
|
||||
if (compound.preLaunchTask) {
|
||||
const taskResult = await this.runTaskAndCheckErrors(launch?.workspace || this.contextService.getWorkspace(), compound.preLaunchTask);
|
||||
if (taskResult === TaskRunResult.Failure) {
|
||||
this.endInitializingState();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const values = await Promise.all(compound.configurations.map(configData => {
|
||||
const name = typeof configData === 'string' ? configData : configData.name;
|
||||
@@ -394,10 +401,10 @@ export class DebugService implements IDebugService {
|
||||
return false;
|
||||
}
|
||||
|
||||
const workspace = launch ? launch.workspace : undefined;
|
||||
const workspace = launch ? launch.workspace : this.contextService.getWorkspace();
|
||||
const taskResult = await this.runTaskAndCheckErrors(workspace, resolvedConfig.preLaunchTask);
|
||||
if (taskResult === TaskRunResult.Success) {
|
||||
return this.doCreateSession(workspace, { resolved: resolvedConfig, unresolved: unresolvedConfig }, options);
|
||||
return this.doCreateSession(launch?.workspace, { resolved: resolvedConfig, unresolved: unresolvedConfig }, options);
|
||||
}
|
||||
return false;
|
||||
} catch (err) {
|
||||
@@ -701,7 +708,7 @@ export class DebugService implements IDebugService {
|
||||
|
||||
//---- task management
|
||||
|
||||
private async runTaskAndCheckErrors(root: IWorkspaceFolder | undefined, taskId: string | TaskIdentifier | undefined): Promise<TaskRunResult> {
|
||||
private async runTaskAndCheckErrors(root: IWorkspaceFolder | IWorkspace | undefined, taskId: string | TaskIdentifier | undefined): Promise<TaskRunResult> {
|
||||
try {
|
||||
const taskSummary = await this.runTask(root, taskId);
|
||||
|
||||
|
||||
@@ -571,21 +571,18 @@ export class RawDebugSession implements IDisposable {
|
||||
const args: string[] = [];
|
||||
|
||||
for (let arg of vscodeArgs.args) {
|
||||
if (arg.prefix) {
|
||||
const a2 = (arg.prefix || '') + (arg.path || '');
|
||||
const match = /^--(.+)=(.+)$/.exec(a2);
|
||||
if (match && match.length === 3) {
|
||||
const key = match[1];
|
||||
let value = match[2];
|
||||
const a2 = (arg.prefix || '') + (arg.path || '');
|
||||
const match = /^--(.+)=(.+)$/.exec(a2);
|
||||
if (match && match.length === 3) {
|
||||
const key = match[1];
|
||||
let value = match[2];
|
||||
|
||||
if ((key === 'file-uri' || key === 'folder-uri') && !isUri(arg.path)) {
|
||||
value = URI.file(value).toString();
|
||||
}
|
||||
|
||||
args.push(`--${key}=${value}`);
|
||||
} else {
|
||||
args.push(a2);
|
||||
if ((key === 'file-uri' || key === 'folder-uri') && !isUri(arg.path)) {
|
||||
value = URI.file(value).toString();
|
||||
}
|
||||
args.push(`--${key}=${value}`);
|
||||
} else {
|
||||
args.push(a2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -505,6 +505,7 @@ export interface IConfig extends IEnvConfig {
|
||||
|
||||
export interface ICompound {
|
||||
name: string;
|
||||
preLaunchTask?: string | TaskIdentifier;
|
||||
configurations: (string | { name: string, folder: string })[];
|
||||
}
|
||||
|
||||
|
||||
@@ -190,6 +190,11 @@ export const launchSchema: IJSONSchema = {
|
||||
}]
|
||||
},
|
||||
description: nls.localize('app.launch.json.compounds.configurations', "Names of configurations that will be started as part of this compound.")
|
||||
},
|
||||
preLaunchTask: {
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: nls.localize('compoundPrelaunchTask', "Task to run before any of the compound configurations start.")
|
||||
}
|
||||
},
|
||||
default: defaultCompound
|
||||
|
||||
@@ -23,7 +23,7 @@ import { ResourceContextKey } from 'vs/workbench/common/resources';
|
||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { SupportsWorkspacesContext, IsWebContext, WorkspaceFolderCountContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { IsWebContext, WorkspaceFolderCountContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { OpenFileFolderAction, OpenFileAction, OpenFolderAction, OpenWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||
import { ActiveEditorIsSaveableContext } from 'vs/workbench/common/editor';
|
||||
@@ -496,7 +496,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
||||
id: ADD_ROOT_FOLDER_COMMAND_ID,
|
||||
title: ADD_ROOT_FOLDER_LABEL
|
||||
},
|
||||
when: ContextKeyExpr.and(ExplorerRootContext, SupportsWorkspacesContext)
|
||||
when: ContextKeyExpr.and(ExplorerRootContext)
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
||||
@@ -506,7 +506,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
||||
id: REMOVE_ROOT_FOLDER_COMMAND_ID,
|
||||
title: REMOVE_ROOT_FOLDER_LABEL
|
||||
},
|
||||
when: ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext, SupportsWorkspacesContext)
|
||||
when: ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext)
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
||||
|
||||
@@ -581,7 +581,8 @@ class OpenEditorRenderer implements IListRenderer<OpenEditor, IOpenEditorTemplat
|
||||
italic: editor.isPreview(),
|
||||
extraClasses: ['open-editor'],
|
||||
fileDecorations: this.configurationService.getValue<IFilesConfiguration>().explorer.decorations,
|
||||
descriptionVerbosity: Verbosity.MEDIUM
|
||||
descriptionVerbosity: Verbosity.MEDIUM,
|
||||
title: editor.editor.getTitle(Verbosity.LONG)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { EncodingMode, ConfirmResult, EditorInput, IFileEditorInput, ITextEditorModel, Verbosity, IRevertOptions } from 'vs/workbench/common/editor';
|
||||
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
|
||||
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
|
||||
import { FileOperationError, FileOperationResult } from 'vs/platform/files/common/files';
|
||||
import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files';
|
||||
import { ITextFileService, AutoSaveMode, ModelState, TextFileModelChangeEvent, LoadReason, TextFileOperationError, TextFileOperationResult } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IReference } from 'vs/base/common/lifecycle';
|
||||
@@ -48,7 +48,8 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@ITextFileService private readonly textFileService: ITextFileService,
|
||||
@ITextModelService private readonly textModelResolverService: ITextModelService,
|
||||
@ILabelService private readonly labelService: ILabelService
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@IFileService private readonly fileService: IFileService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -72,6 +73,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
|
||||
this._register(this.textFileService.models.onModelReverted(e => this.onDirtyStateChange(e)));
|
||||
this._register(this.textFileService.models.onModelOrphanedChanged(e => this.onModelOrphanedChanged(e)));
|
||||
this._register(this.labelService.onDidChangeFormatters(() => FileEditorInput.MEMOIZER.clear()));
|
||||
this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(() => FileEditorInput.MEMOIZER.clear()));
|
||||
}
|
||||
|
||||
private onDirtyStateChange(e: TextFileModelChangeEvent): void {
|
||||
|
||||
@@ -44,7 +44,16 @@
|
||||
padding: 0px 8px;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
right: 35px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-header > .search-container > .settings-clear-widget {
|
||||
margin: 6px 0px;
|
||||
padding: 0px 8px;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,13 @@ 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, EXTENSION_SETTING_TAG, IPreferencesSearchService, ISearchProvider, MODIFIED_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, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS } 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';
|
||||
import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
function createGroupIterator(group: SettingsTreeGroupElement): Iterator<ITreeElement<SettingsTreeGroupChild>> {
|
||||
const groupsIt = Iterator.fromArray(group.children);
|
||||
@@ -132,6 +134,9 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
private scheduledRefreshes: Map<string, DOM.IFocusTracker>;
|
||||
private lastFocusedSettingElement: string | null = null;
|
||||
|
||||
private actionBar: ActionBar;
|
||||
private actionsContainer: HTMLElement;
|
||||
|
||||
/** Don't spam warnings */
|
||||
private hasWarnedMissingSettings = false;
|
||||
|
||||
@@ -385,11 +390,18 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
this.searchWidget.setValue(query.trim());
|
||||
}
|
||||
|
||||
clearSearch(): void {
|
||||
this.clearSearchResults();
|
||||
this.focusSearch();
|
||||
}
|
||||
|
||||
private createHeader(parent: HTMLElement): void {
|
||||
this.headerContainer = DOM.append(parent, $('.settings-header'));
|
||||
|
||||
const searchContainer = DOM.append(this.headerContainer, $('.search-container'));
|
||||
|
||||
const clearInputAction = new Action(SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, localize('clearInput', "Clear Settings Search Input"), 'codicon-clear-all', false, () => { this.clearSearch(); return Promise.resolve(null); });
|
||||
|
||||
const searchBoxLabel = localize('SearchSettings.AriaLabel', "Search settings");
|
||||
this.searchWidget = this._register(this.instantiationService.createInstance(SuggestEnabledInput, `${SettingsEditor2.ID}.searchbox`, searchContainer, {
|
||||
triggerCharacters: ['@'],
|
||||
@@ -425,13 +437,26 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
this.countElement.style.borderColor = border;
|
||||
}));
|
||||
|
||||
this._register(this.searchWidget.onInputDidChange(() => this.onSearchInputChanged()));
|
||||
this._register(this.searchWidget.onInputDidChange(() => {
|
||||
const searchVal = this.searchWidget.getValue();
|
||||
clearInputAction.enabled = !!searchVal;
|
||||
this.onSearchInputChanged();
|
||||
}));
|
||||
|
||||
const headerControlsContainer = DOM.append(this.headerContainer, $('.settings-header-controls'));
|
||||
const targetWidgetContainer = DOM.append(headerControlsContainer, $('.settings-target-container'));
|
||||
this.settingsTargetsWidget = this._register(this.instantiationService.createInstance(SettingsTargetsWidget, targetWidgetContainer, { enableRemoteSettings: true }));
|
||||
this.settingsTargetsWidget.settingsTarget = ConfigurationTarget.USER_LOCAL;
|
||||
this.settingsTargetsWidget.onDidTargetChange(target => this.onDidSettingsTargetChange(target));
|
||||
|
||||
this.actionsContainer = DOM.append(searchContainer, DOM.$('.settings-clear-widget'));
|
||||
|
||||
this.actionBar = this._register(new ActionBar(this.actionsContainer, {
|
||||
animated: false,
|
||||
actionViewItemProvider: (action: Action) => { return undefined; }
|
||||
}));
|
||||
|
||||
this.actionBar.push([clearInputAction], { label: false, icon: true });
|
||||
}
|
||||
|
||||
private onDidSettingsTargetChange(target: SettingsTarget): void {
|
||||
|
||||
@@ -245,7 +245,7 @@ export class SearchView extends ViewletPanel {
|
||||
if (this.searchWidget.isReplaceActive()) {
|
||||
this.searchWidget.focusReplaceAllAction();
|
||||
} else {
|
||||
this.searchWidget.focusRegexAction();
|
||||
this.searchWidget.isReplaceShown() ? this.searchWidget.replaceInput.focusOnPreserve() : this.searchWidget.focusRegexAction();
|
||||
}
|
||||
dom.EventHelper.stop(e);
|
||||
}
|
||||
|
||||
@@ -389,6 +389,7 @@ export class SearchWidget extends Widget {
|
||||
this.replaceInputFocusTracker = this._register(dom.trackFocus(this.replaceInput.inputBox.inputElement));
|
||||
this._register(this.replaceInputFocusTracker.onDidFocus(() => this.replaceInputBoxFocused.set(true)));
|
||||
this._register(this.replaceInputFocusTracker.onDidBlur(() => this.replaceInputBoxFocused.set(false)));
|
||||
this._register(this.replaceInput.onPreserveCaseKeyDown((keyboardEvent: IKeyboardEvent) => this.onPreserveCaseKeyDown(keyboardEvent)));
|
||||
}
|
||||
|
||||
triggerReplaceAll(): Promise<any> {
|
||||
@@ -495,6 +496,15 @@ export class SearchWidget extends Widget {
|
||||
}
|
||||
|
||||
private onRegexKeyDown(keyboardEvent: IKeyboardEvent) {
|
||||
if (keyboardEvent.equals(KeyCode.Tab)) {
|
||||
if (this.isReplaceShown()) {
|
||||
this.replaceInput.focusOnPreserve();
|
||||
keyboardEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private onPreserveCaseKeyDown(keyboardEvent: IKeyboardEvent) {
|
||||
if (keyboardEvent.equals(KeyCode.Tab)) {
|
||||
if (this.isReplaceActive()) {
|
||||
this.focusReplaceAllAction();
|
||||
@@ -503,6 +513,10 @@ export class SearchWidget extends Widget {
|
||||
}
|
||||
keyboardEvent.preventDefault();
|
||||
}
|
||||
else if (KeyMod.Shift | KeyCode.Tab) {
|
||||
this.focusRegexAction();
|
||||
keyboardEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
private onReplaceInputKeyDown(keyboardEvent: IKeyboardEvent) {
|
||||
|
||||
@@ -81,6 +81,7 @@ import { find } from 'vs/base/common/arrays';
|
||||
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
|
||||
const QUICKOPEN_HISTORY_LIMIT_CONFIG = 'task.quickOpen.history';
|
||||
const QUICKOPEN_DETAIL_CONFIG = 'task.quickOpen.detail';
|
||||
|
||||
export namespace ConfigureTaskAction {
|
||||
export const ID = 'workbench.action.tasks.configureTaskRunner';
|
||||
@@ -744,7 +745,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
}
|
||||
if (CustomTask.is(task)) {
|
||||
let configProperties: TaskConfig.ConfigurationProperties = task._source.config.element;
|
||||
return configProperties.problemMatcher === undefined && !task.hasDefinedMatchers;
|
||||
const type: string = (<any>configProperties).type;
|
||||
return configProperties.problemMatcher === undefined && !task.hasDefinedMatchers && (Types.isStringArray(settingValue) && (settingValue.indexOf(type) < 0));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1297,7 +1299,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
this.notificationService.prompt(Severity.Warning, nls.localize('TaskSystem.slowProvider', "The {0} task provider is slow. The extension that provides {0} tasks may provide a setting to disable it, or you can disable all tasks providers", type),
|
||||
[settings, disableAll, dontShow]);
|
||||
}
|
||||
}, 1000);
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1876,6 +1878,10 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
return true;
|
||||
}
|
||||
|
||||
private showDetail(): boolean {
|
||||
return this.configurationService.getValue<boolean>(QUICKOPEN_DETAIL_CONFIG);
|
||||
}
|
||||
|
||||
private createTaskQuickPickEntries(tasks: Task[], group: boolean = false, sort: boolean = false, selectedEntry?: TaskQuickPickEntry): TaskQuickPickEntry[] {
|
||||
if (tasks === undefined || tasks === null || tasks.length === 0) {
|
||||
return [];
|
||||
@@ -1892,7 +1898,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
description = workspaceFolder.name;
|
||||
}
|
||||
}
|
||||
return { label: task._label, description, task };
|
||||
|
||||
return { label: task._label, description, task, detail: this.showDetail() ? task.configurationProperties.detail : undefined };
|
||||
};
|
||||
function fillEntries(entries: QuickPickInput<TaskQuickPickEntry>[], tasks: Task[], groupLabel: string): void {
|
||||
if (tasks.length) {
|
||||
|
||||
@@ -358,5 +358,10 @@ configurationRegistry.registerConfiguration({
|
||||
type: 'number',
|
||||
default: 30, minimum: 0, maximum: 30
|
||||
},
|
||||
'task.quickOpen.detail': {
|
||||
markdownDescription: nls.localize('task.quickOpen.detail', "Controls whether to show the task detail for task that have a detail in the Run Task quick pick."),
|
||||
type: 'boolean',
|
||||
default: true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -89,6 +89,11 @@ const dependsOrder: IJSONSchema = {
|
||||
description: nls.localize('JsonSchema.tasks.dependsOrder', 'Determines the order of the dependsOn tasks for this task. Note that this property is not recursive.')
|
||||
};
|
||||
|
||||
const detail: IJSONSchema = {
|
||||
type: 'string',
|
||||
description: nls.localize('JsonSchema.tasks.detail', 'An optional description of a task that shows in the Run Task quick pick as a detail.')
|
||||
};
|
||||
|
||||
const presentation: IJSONSchema = {
|
||||
type: 'object',
|
||||
default: {
|
||||
@@ -365,7 +370,8 @@ let taskConfiguration: IJSONSchema = {
|
||||
},
|
||||
runOptions: Objects.deepClone(runOptions),
|
||||
dependsOn: Objects.deepClone(dependsOn),
|
||||
dependsOrder: Objects.deepClone(dependsOrder)
|
||||
dependsOrder: Objects.deepClone(dependsOrder),
|
||||
detail: Objects.deepClone(detail),
|
||||
}
|
||||
};
|
||||
|
||||
@@ -425,6 +431,7 @@ taskDescriptionProperties.presentation = Objects.deepClone(presentation);
|
||||
taskDescriptionProperties.terminal = terminal;
|
||||
taskDescriptionProperties.group = Objects.deepClone(group);
|
||||
taskDescriptionProperties.runOptions = Objects.deepClone(runOptions);
|
||||
taskDescriptionProperties.detail = detail;
|
||||
taskDescriptionProperties.taskName.deprecationMessage = nls.localize(
|
||||
'JsonSchema.tasks.taskName.deprecated',
|
||||
'The task\'s name property is deprecated. Use the label property instead.'
|
||||
|
||||
@@ -309,6 +309,11 @@ export interface ConfigurationProperties {
|
||||
*/
|
||||
group?: string | GroupKind;
|
||||
|
||||
/**
|
||||
* A description of the task.
|
||||
*/
|
||||
detail?: string;
|
||||
|
||||
/**
|
||||
* The other tasks the task depend on
|
||||
*/
|
||||
@@ -1326,6 +1331,9 @@ namespace ConfigurationProperties {
|
||||
if (configProblemMatcher !== undefined) {
|
||||
result.problemMatchers = configProblemMatcher;
|
||||
}
|
||||
if (external.detail) {
|
||||
result.detail = external.detail;
|
||||
}
|
||||
return isEmpty(result) ? undefined : result;
|
||||
}
|
||||
|
||||
@@ -1587,6 +1595,7 @@ namespace CustomTask {
|
||||
assignProperty(resultConfigProps, configuredProps.configurationProperties, 'dependsOn');
|
||||
assignProperty(resultConfigProps, configuredProps.configurationProperties, 'problemMatchers');
|
||||
assignProperty(resultConfigProps, configuredProps.configurationProperties, 'promptOnClose');
|
||||
assignProperty(resultConfigProps, configuredProps.configurationProperties, 'detail');
|
||||
result.command.presentation = CommandConfiguration.PresentationOptions.assignProperties(
|
||||
result.command.presentation!, configuredProps.configurationProperties.presentation)!;
|
||||
result.command.options = CommandOptions.assignProperties(result.command.options, configuredProps.configurationProperties.options);
|
||||
@@ -1598,6 +1607,7 @@ namespace CustomTask {
|
||||
fillProperty(resultConfigProps, contributedConfigProps, 'dependsOn');
|
||||
fillProperty(resultConfigProps, contributedConfigProps, 'problemMatchers');
|
||||
fillProperty(resultConfigProps, contributedConfigProps, 'promptOnClose');
|
||||
fillProperty(resultConfigProps, contributedConfigProps, 'detail');
|
||||
result.command.presentation = CommandConfiguration.PresentationOptions.fillProperties(
|
||||
result.command.presentation!, contributedConfigProps.presentation)!;
|
||||
result.command.options = CommandOptions.fillProperties(result.command.options, contributedConfigProps.options);
|
||||
|
||||
@@ -504,6 +504,11 @@ export interface ConfigurationProperties {
|
||||
*/
|
||||
dependsOrder?: DependsOrder;
|
||||
|
||||
/**
|
||||
* A description of the task.
|
||||
*/
|
||||
detail?: string;
|
||||
|
||||
/**
|
||||
* The problem watchers to use for this task
|
||||
*/
|
||||
|
||||
@@ -219,10 +219,11 @@ configurationRegistry.registerConfiguration({
|
||||
},
|
||||
'terminal.integrated.rightClickBehavior': {
|
||||
type: 'string',
|
||||
enum: ['default', 'copyPaste', 'selectWord'],
|
||||
enum: ['default', 'copyPaste', 'paste', 'selectWord'],
|
||||
enumDescriptions: [
|
||||
nls.localize('terminal.integrated.rightClickBehavior.default', "Show the context menu."),
|
||||
nls.localize('terminal.integrated.rightClickBehavior.copyPaste', "Copy when there is a selection, otherwise paste."),
|
||||
nls.localize('terminal.integrated.rightClickBehavior.paste', "Paste on right click."),
|
||||
nls.localize('terminal.integrated.rightClickBehavior.selectWord', "Select the word under the cursor and show the context menu.")
|
||||
],
|
||||
default: platform.isMacintosh ? 'selectWord' : platform.isWindows ? 'copyPaste' : 'default',
|
||||
@@ -361,9 +362,7 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusNextTermina
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusPreviousTerminalAction, FocusPreviousTerminalAction.ID, FocusPreviousTerminalAction.LABEL), 'Terminal: Focus Previous Terminal', category);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(TerminalPasteAction, TerminalPasteAction.ID, TerminalPasteAction.LABEL, {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_V },
|
||||
// Don't apply to Mac since cmd+v works
|
||||
mac: { primary: 0 }
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_V }
|
||||
}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Paste into Active Terminal', category);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectAllTerminalAction, SelectAllTerminalAction.ID, SelectAllTerminalAction.LABEL, {
|
||||
// Don't use ctrl+a by default as that would override the common go to start
|
||||
|
||||
@@ -144,7 +144,7 @@ export interface ITerminalService {
|
||||
preparePathForTerminalAsync(path: string, executable: string | undefined, title: string): Promise<string>;
|
||||
|
||||
extHostReady(remoteAuthority: string): void;
|
||||
requestSpawnExtHostProcess(proxy: ITerminalProcessExtHostProxy, shellLaunchConfig: IShellLaunchConfig, activeWorkspaceRootUri: URI, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
|
||||
requestSpawnExtHostProcess(proxy: ITerminalProcessExtHostProxy, shellLaunchConfig: IShellLaunchConfig, activeWorkspaceRootUri: URI | undefined, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
|
||||
requestStartExtensionTerminal(proxy: ITerminalProcessExtHostProxy, cols: number, rows: number): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -218,12 +218,13 @@ export class TerminalPanel extends Panel {
|
||||
terminal.focus();
|
||||
}
|
||||
} else if (event.which === 3) {
|
||||
if (this._terminalService.configHelper.config.rightClickBehavior === 'copyPaste') {
|
||||
const rightClickBehavior = this._terminalService.configHelper.config.rightClickBehavior;
|
||||
if (rightClickBehavior === 'copyPaste' || rightClickBehavior === 'paste') {
|
||||
const terminal = this._terminalService.getActiveInstance();
|
||||
if (!terminal) {
|
||||
return;
|
||||
}
|
||||
if (terminal.hasSelection()) {
|
||||
if (rightClickBehavior === 'copyPaste' && terminal.hasSelection()) {
|
||||
await terminal.copySelection();
|
||||
terminal.clearSelection();
|
||||
} else {
|
||||
|
||||
@@ -48,7 +48,7 @@ export class TerminalProcessExtHostProxy extends Disposable implements ITerminal
|
||||
constructor(
|
||||
public terminalId: number,
|
||||
shellLaunchConfig: IShellLaunchConfig,
|
||||
activeWorkspaceRootUri: URI,
|
||||
activeWorkspaceRootUri: URI | undefined,
|
||||
cols: number,
|
||||
rows: number,
|
||||
configHelper: ITerminalConfigHelper,
|
||||
|
||||
@@ -134,7 +134,7 @@ export class TerminalService implements ITerminalService {
|
||||
return activeInstance ? activeInstance : this.createTerminal(undefined);
|
||||
}
|
||||
|
||||
public requestSpawnExtHostProcess(proxy: ITerminalProcessExtHostProxy, shellLaunchConfig: IShellLaunchConfig, activeWorkspaceRootUri: URI, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void {
|
||||
public requestSpawnExtHostProcess(proxy: ITerminalProcessExtHostProxy, shellLaunchConfig: IShellLaunchConfig, activeWorkspaceRootUri: URI | undefined, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void {
|
||||
this._extensionService.whenInstalledExtensionsRegistered().then(async () => {
|
||||
// Wait for the remoteAuthority to be ready (and listening for events) before firing
|
||||
// the event to spawn the ext host process
|
||||
|
||||
@@ -88,7 +88,7 @@ export interface ITerminalConfiguration {
|
||||
macOptionIsMeta: boolean;
|
||||
macOptionClickForcesSelection: boolean;
|
||||
rendererType: 'auto' | 'canvas' | 'dom';
|
||||
rightClickBehavior: 'default' | 'copyPaste' | 'selectWord';
|
||||
rightClickBehavior: 'default' | 'copyPaste' | 'paste' | 'selectWord';
|
||||
cursorBlinking: boolean;
|
||||
cursorStyle: string;
|
||||
drawBoldTextInBrightColors: boolean;
|
||||
@@ -343,7 +343,7 @@ export interface ITerminalProcessExtHostProxy extends IDisposable {
|
||||
export interface ISpawnExtHostProcessRequest {
|
||||
proxy: ITerminalProcessExtHostProxy;
|
||||
shellLaunchConfig: IShellLaunchConfig;
|
||||
activeWorkspaceRootUri: URI;
|
||||
activeWorkspaceRootUri: URI | undefined;
|
||||
cols: number;
|
||||
rows: number;
|
||||
isWorkspaceShellAllowed: boolean;
|
||||
|
||||
@@ -479,6 +479,7 @@
|
||||
newFrame.contentWindow.addEventListener('click', handleInnerClick);
|
||||
newFrame.contentWindow.addEventListener('auxclick', handleAuxClick);
|
||||
newFrame.contentWindow.addEventListener('keydown', handleInnerKeydown);
|
||||
newFrame.contentWindow.addEventListener('contextmenu', e => e.preventDefault());
|
||||
|
||||
if (host.onIframeLoaded) {
|
||||
host.onIframeLoaded(newFrame);
|
||||
|
||||
@@ -92,9 +92,13 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
|
||||
}
|
||||
|
||||
private preprocessHtml(value: string): string {
|
||||
return value.replace(/(["'])vscode-resource:(\/\/([^\s'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi, (_, startQuote, _1, scheme, path, endQuote) => {
|
||||
return `${startQuote}${this.externalEndpoint}/vscode-resource/${scheme || ''}${path}${endQuote}`;
|
||||
});
|
||||
return value
|
||||
.replace(/(["'])vscode-resource:(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi, (match, startQuote, _1, scheme, path, endQuote) => {
|
||||
if (scheme) {
|
||||
return `${startQuote}${this.externalEndpoint}/vscode-resource/${scheme}${path}${endQuote}`;
|
||||
}
|
||||
return `${startQuote}${this.externalEndpoint}/vscode-resource/file${path}${endQuote}`;
|
||||
});
|
||||
}
|
||||
|
||||
protected get extraContentOptions() {
|
||||
|
||||
Reference in New Issue
Block a user