mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
VS Code merge to df8fe74bd55313de0dd2303bc47a4aab0ca56b0e (#17979)
* Merge from vscode 504f934659740e9d41501cad9f162b54d7745ad9 * delete unused folders * distro * Bump build node version * update chokidar * FIx hygiene errors * distro * Fix extension lint issues * Remove strict-vscode * Add copyright header exemptions * Bump vscode-extension-telemetry to fix webpacking issue with zone.js * distro * Fix failing tests (revert marked.js back to current one until we decide to update) * Skip searchmodel test * Fix mac build * temp debug script loading * Try disabling coverage * log error too * Revert "log error too" This reverts commit af0183e5d4ab458fdf44b88fbfab9908d090526f. * Revert "temp debug script loading" This reverts commit 3d687d541c76db2c5b55626c78ae448d3c25089c. * Add comments explaining coverage disabling * Fix ansi_up loading issue * Merge latest from ads * Use newer option * Fix compile * add debug logging warn * Always log stack * log more * undo debug * Update to use correct base path (+cleanup) * distro * fix compile errors * Remove strict-vscode * Fix sql editors not showing * Show db dropdown input & fix styling * Fix more info in gallery * Fix gallery asset requests * Delete unused workflow * Fix tapable resolutions for smoke test compile error * Fix smoke compile * Disable crash reporting * Disable interactive Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -44,13 +44,13 @@ import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder, IWorkspace,
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IOutputService, IOutputChannel } from 'vs/workbench/contrib/output/common/output';
|
||||
|
||||
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalGroupService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalProfileResolverService } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
|
||||
import { ITaskSystem, ITaskResolver, ITaskSummary, TaskExecuteKind, TaskError, TaskErrors, TaskTerminateResponse, TaskSystemInfo, ITaskExecuteResult } from 'vs/workbench/contrib/tasks/common/taskSystem';
|
||||
import {
|
||||
Task, CustomTask, ConfiguringTask, ContributedTask, InMemoryTask, TaskEvent,
|
||||
TaskSet, TaskGroup, GroupType, ExecutionEngine, JsonSchemaVersion, TaskSourceKind,
|
||||
TaskSet, TaskGroup, ExecutionEngine, JsonSchemaVersion, TaskSourceKind,
|
||||
TaskSorter, TaskIdentifier, KeyedTaskIdentifier, TASK_RUNNING_STATE, TaskRunSource,
|
||||
KeyedTaskIdentifier as NKeyedTaskIdentifier, TaskDefinition, RuntimeType
|
||||
} from 'vs/workbench/contrib/tasks/common/tasks';
|
||||
@@ -260,6 +260,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@IConfigurationResolverService protected readonly configurationResolverService: IConfigurationResolverService,
|
||||
@ITerminalService private readonly terminalService: ITerminalService,
|
||||
@ITerminalGroupService private readonly terminalGroupService: ITerminalGroupService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IProgressService private readonly progressService: IProgressService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@@ -312,11 +313,11 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
this.configurationResolverService.contributeVariable('defaultBuildTask', async (): Promise<string | undefined> => {
|
||||
let tasks = await this.getTasksForGroup(TaskGroup.Build);
|
||||
if (tasks.length > 0) {
|
||||
let { defaults, users } = this.splitPerGroupType(tasks);
|
||||
let { none, defaults } = this.splitPerGroupType(tasks);
|
||||
if (defaults.length === 1) {
|
||||
return defaults[0]._label;
|
||||
} else if (defaults.length + users.length > 0) {
|
||||
tasks = defaults.concat(users);
|
||||
} else if (defaults.length + none.length > 0) {
|
||||
tasks = defaults.concat(none);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +528,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
}
|
||||
|
||||
protected showOutput(runSource: TaskRunSource = TaskRunSource.User): void {
|
||||
if ((runSource === TaskRunSource.User) || (runSource === TaskRunSource.ConfigurationChange)) {
|
||||
if (!VirtualWorkspaceContext.getValue(this.contextKeyService) && ((runSource === TaskRunSource.User) || (runSource === TaskRunSource.ConfigurationChange))) {
|
||||
this.notificationService.prompt(Severity.Warning, nls.localize('taskServiceOutputPrompt', 'There are task errors. See the output for details.'),
|
||||
[{
|
||||
label: nls.localize('showOutput', "Show output"),
|
||||
@@ -1108,12 +1109,13 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
return Promise.resolve(task);
|
||||
}
|
||||
|
||||
private getTasksForGroup(group: string): Promise<Task[]> {
|
||||
private getTasksForGroup(group: TaskGroup): Promise<Task[]> {
|
||||
return this.getGroupedTasks().then((groups) => {
|
||||
let result: Task[] = [];
|
||||
groups.forEach((tasks) => {
|
||||
for (let task of tasks) {
|
||||
if (task.configurationProperties.group === group) {
|
||||
let configTaskGroup = TaskGroup.from(task.configurationProperties.group);
|
||||
if (configTaskGroup?._id === group._id) {
|
||||
result.push(task);
|
||||
}
|
||||
}
|
||||
@@ -1230,7 +1232,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
toCustomize.problemMatcher = task.configurationProperties.problemMatchers;
|
||||
}
|
||||
if (task.configurationProperties.group) {
|
||||
toCustomize.group = task.configurationProperties.group;
|
||||
toCustomize.group = TaskConfig.GroupKind.to(task.configurationProperties.group);
|
||||
}
|
||||
}
|
||||
if (!toCustomize) {
|
||||
@@ -1671,7 +1673,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
|
||||
protected createTerminalTaskSystem(): ITaskSystem {
|
||||
return new TerminalTaskSystem(
|
||||
this.terminalService, this.outputService, this.panelService, this.viewsService, this.markerService,
|
||||
this.terminalService, this.terminalGroupService, this.outputService, this.panelService, this.viewsService, this.markerService,
|
||||
this.modelService, this.configurationResolverService, this.telemetryService,
|
||||
this.contextService, this.environmentService,
|
||||
AbstractTaskService.OutputChannelId, this.fileService, this.terminalProfileResolverService,
|
||||
@@ -2061,7 +2063,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
if (this.executionEngine === ExecutionEngine.Process) {
|
||||
return this.emptyWorkspaceTaskResults(workspaceFolder);
|
||||
}
|
||||
const configuration = this.testParseExternalConfig(this.configurationService.inspect<TaskConfig.ExternalTaskRunnerConfiguration>('tasks').workspaceValue, nls.localize('TasksSystem.locationWorkspaceConfig', 'workspace file'));
|
||||
const workspaceFileConfig = this.getConfiguration(workspaceFolder, TaskSourceKind.WorkspaceFile);
|
||||
const configuration = this.testParseExternalConfig(workspaceFileConfig.config, nls.localize('TasksSystem.locationWorkspaceConfig', 'workspace file'));
|
||||
let customizedTasks: { byIdentifier: IStringDictionary<ConfiguringTask>; } = {
|
||||
byIdentifier: Object.create(null)
|
||||
};
|
||||
@@ -2080,7 +2083,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
if (this.executionEngine === ExecutionEngine.Process) {
|
||||
return this.emptyWorkspaceTaskResults(workspaceFolder);
|
||||
}
|
||||
const configuration = this.testParseExternalConfig(this.configurationService.inspect<TaskConfig.ExternalTaskRunnerConfiguration>('tasks').userValue, nls.localize('TasksSystem.locationUserConfig', 'user settings'));
|
||||
const userTasksConfig = this.getConfiguration(workspaceFolder, TaskSourceKind.User);
|
||||
const configuration = this.testParseExternalConfig(userTasksConfig.config, nls.localize('TasksSystem.locationUserConfig', 'user settings'));
|
||||
let customizedTasks: { byIdentifier: IStringDictionary<ConfiguringTask>; } = {
|
||||
byIdentifier: Object.create(null)
|
||||
};
|
||||
@@ -2192,14 +2196,25 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
|
||||
protected getConfiguration(workspaceFolder: IWorkspaceFolder, source?: string): { config: TaskConfig.ExternalTaskRunnerConfiguration | undefined; hasParseErrors: boolean } {
|
||||
let result;
|
||||
if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
|
||||
if ((source !== TaskSourceKind.User) && (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY)) {
|
||||
result = undefined;
|
||||
} else {
|
||||
const wholeConfig = this.configurationService.inspect<TaskConfig.ExternalTaskRunnerConfiguration>('tasks', { resource: workspaceFolder.uri });
|
||||
switch (source) {
|
||||
case TaskSourceKind.User: result = Objects.deepClone(wholeConfig.userValue); break;
|
||||
case TaskSourceKind.User: {
|
||||
if (wholeConfig.userValue !== wholeConfig.workspaceFolderValue) {
|
||||
result = Objects.deepClone(wholeConfig.userValue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TaskSourceKind.Workspace: result = Objects.deepClone(wholeConfig.workspaceFolderValue); break;
|
||||
case TaskSourceKind.WorkspaceFile: result = Objects.deepClone(wholeConfig.workspaceValue); break;
|
||||
case TaskSourceKind.WorkspaceFile: {
|
||||
if ((this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE)
|
||||
&& (wholeConfig.workspaceFolderValue !== wholeConfig.workspaceValue)) {
|
||||
result = Objects.deepClone(wholeConfig.workspaceValue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: result = Objects.deepClone(wholeConfig.workspaceFolderValue);
|
||||
}
|
||||
}
|
||||
@@ -2633,20 +2648,17 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
});
|
||||
}
|
||||
|
||||
private splitPerGroupType(tasks: Task[]): { none: Task[], defaults: Task[], users: Task[] } {
|
||||
private splitPerGroupType(tasks: Task[]): { none: Task[], defaults: Task[] } {
|
||||
let none: Task[] = [];
|
||||
let defaults: Task[] = [];
|
||||
let users: Task[] = [];
|
||||
for (let task of tasks) {
|
||||
if (task.configurationProperties.groupType === GroupType.default) {
|
||||
if ((task.configurationProperties.group as TaskGroup).isDefault) {
|
||||
defaults.push(task);
|
||||
} else if (task.configurationProperties.groupType === GroupType.user) {
|
||||
users.push(task);
|
||||
} else {
|
||||
none.push(task);
|
||||
}
|
||||
}
|
||||
return { none, defaults, users };
|
||||
return { none, defaults };
|
||||
}
|
||||
|
||||
private runBuildCommand(): void {
|
||||
@@ -2665,9 +2677,12 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
const buildTasks: ConfiguringTask[] = [];
|
||||
for (const taskSource of tasks) {
|
||||
for (const task in taskSource[1].configurations?.byIdentifier) {
|
||||
if ((taskSource[1].configurations?.byIdentifier[task].configurationProperties.group === TaskGroup.Build) &&
|
||||
(taskSource[1].configurations?.byIdentifier[task].configurationProperties.groupType === GroupType.default)) {
|
||||
buildTasks.push(taskSource[1].configurations.byIdentifier[task]);
|
||||
if (taskSource[1].configurations) {
|
||||
const taskGroup: TaskGroup = taskSource[1].configurations.byIdentifier[task].configurationProperties.group as TaskGroup;
|
||||
|
||||
if (taskGroup && taskGroup._id === TaskGroup.Build._id && taskGroup.isDefault) {
|
||||
buildTasks.push(taskSource[1].configurations.byIdentifier[task]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2682,14 +2697,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
|
||||
return this.getTasksForGroup(TaskGroup.Build).then((tasks) => {
|
||||
if (tasks.length > 0) {
|
||||
let { defaults, users } = this.splitPerGroupType(tasks);
|
||||
let { none, defaults } = this.splitPerGroupType(tasks);
|
||||
if (defaults.length === 1) {
|
||||
this.run(defaults[0], undefined, TaskRunSource.User).then(undefined, reason => {
|
||||
// eat the error, it has already been surfaced to the user and we don't care about it here
|
||||
});
|
||||
return;
|
||||
} else if (defaults.length + users.length > 0) {
|
||||
tasks = defaults.concat(users);
|
||||
} else if (defaults.length + none.length > 0) {
|
||||
tasks = defaults.concat(none);
|
||||
}
|
||||
}
|
||||
this.showIgnoredFoldersMessage().then(() => {
|
||||
@@ -2732,14 +2747,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
};
|
||||
let promise = this.getTasksForGroup(TaskGroup.Test).then((tasks) => {
|
||||
if (tasks.length > 0) {
|
||||
let { defaults, users } = this.splitPerGroupType(tasks);
|
||||
let { none, defaults } = this.splitPerGroupType(tasks);
|
||||
if (defaults.length === 1) {
|
||||
this.run(defaults[0], undefined, TaskRunSource.User).then(undefined, reason => {
|
||||
// eat the error, it has already been surfaced to the user and we don't care about it here
|
||||
});
|
||||
return;
|
||||
} else if (defaults.length + users.length > 0) {
|
||||
tasks = defaults.concat(users);
|
||||
} else if (defaults.length + none.length > 0) {
|
||||
tasks = defaults.concat(none);
|
||||
}
|
||||
}
|
||||
this.showIgnoredFoldersMessage().then(() => {
|
||||
@@ -2918,7 +2933,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
content = pickTemplateResult.content;
|
||||
let editorConfig = this.configurationService.getValue<any>();
|
||||
let editorConfig = this.configurationService.getValue() as any;
|
||||
if (editorConfig.editor.insertSpaces) {
|
||||
content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + ' '.repeat(s2.length * editorConfig.editor.tabSize));
|
||||
}
|
||||
@@ -3116,7 +3131,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
let selectedTask: Task | undefined;
|
||||
let selectedEntry: TaskQuickPickEntry;
|
||||
for (let task of tasks) {
|
||||
if (task.configurationProperties.group === TaskGroup.Build && task.configurationProperties.groupType === GroupType.default) {
|
||||
let taskGroup: TaskGroup | undefined = TaskGroup.from(task.configurationProperties.group);
|
||||
if (taskGroup && taskGroup.isDefault && taskGroup._id === TaskGroup.Build._id) {
|
||||
selectedTask = task;
|
||||
break;
|
||||
}
|
||||
@@ -3168,7 +3184,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
let selectedEntry: TaskQuickPickEntry;
|
||||
|
||||
for (let task of tasks) {
|
||||
if (task.configurationProperties.group === TaskGroup.Test && task.configurationProperties.groupType === GroupType.default) {
|
||||
let taskGroup: TaskGroup | undefined = TaskGroup.from(task.configurationProperties.group);
|
||||
if (taskGroup && taskGroup.isDefault && taskGroup._id === TaskGroup.Test._id) {
|
||||
selectedTask = task;
|
||||
break;
|
||||
}
|
||||
@@ -3215,7 +3232,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
let group: string | undefined;
|
||||
if (activeTasks.length === 1) {
|
||||
this._taskSystem!.revealTask(activeTasks[0]);
|
||||
} else if (activeTasks.every((task) => {
|
||||
} else if (activeTasks.length && activeTasks.every((task) => {
|
||||
if (InMemoryTask.is(task)) {
|
||||
return false;
|
||||
}
|
||||
@@ -3310,7 +3327,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.workspaceTrustManagementService.isWorkpaceTrusted()) {
|
||||
if (!this.workspaceTrustManagementService.isWorkspaceTrusted()) {
|
||||
this._register(Event.once(this.workspaceTrustManagementService.onDidChangeTrust)(isTrusted => {
|
||||
if (isTrusted) {
|
||||
this.upgrade();
|
||||
@@ -3368,8 +3385,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
run: async () => {
|
||||
for (const upgrade of fileDiffs) {
|
||||
await this.editorService.openEditor({
|
||||
originalInput: { resource: upgrade[0] },
|
||||
modifiedInput: { resource: upgrade[1] }
|
||||
original: { resource: upgrade[0] },
|
||||
modified: { resource: upgrade[1] }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user