Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25 (#7929)

* Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25

* fix launch script

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-22 21:49:55 -07:00
committed by GitHub
parent 4a68ab4659
commit a94cbb528e
189 changed files with 1976 additions and 1541 deletions

View File

@@ -323,6 +323,9 @@ namespace TaskDTO {
if (task.configurationProperties.group) {
result.group = task.configurationProperties.group;
}
if (task.configurationProperties.detail) {
result.detail = task.configurationProperties.detail;
}
if (!ConfiguringTask.is(task) && task.command) {
if (task.command.runtime === RuntimeType.Process) {
result.execution = ProcessExecutionDTO.from(task.command);
@@ -380,6 +383,7 @@ namespace TaskDTO {
group: task.group,
isBackground: !!task.isBackground,
problemMatchers: task.problemMatchers.slice(),
detail: task.detail
}
);
return result;

View File

@@ -1198,7 +1198,7 @@ export interface ExtHostTerminalServiceShape {
$acceptTerminalTitleChange(id: number, name: string): void;
$acceptTerminalDimensions(id: number, cols: number, rows: number): void;
$acceptTerminalMaximumDimensions(id: number, cols: number, rows: number): void;
$spawnExtHostProcess(id: number, shellLaunchConfig: IShellLaunchConfigDto, activeWorkspaceRootUri: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
$spawnExtHostProcess(id: number, shellLaunchConfig: IShellLaunchConfigDto, activeWorkspaceRootUri: UriComponents | undefined, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
$startExtensionTerminal(id: number, initialDimensions: ITerminalDimensionsDto | undefined): void;
$acceptProcessInput(id: number, data: string): void;
$acceptProcessResize(id: number, cols: number, rows: number): void;

View File

@@ -740,14 +740,14 @@ class SuggestAdapter {
// 'insertText'-logic
if (item.textEdit) {
result.h = item.textEdit.newText;
result[extHostProtocol.ISuggestDataDtoField.insertText] = item.textEdit.newText;
} else if (typeof item.insertText === 'string') {
result.h = item.insertText;
result[extHostProtocol.ISuggestDataDtoField.insertText] = item.insertText;
} else if (item.insertText instanceof SnippetString) {
result.h = item.insertText.value;
result.i! |= modes.CompletionItemInsertTextRule.InsertAsSnippet;
result[extHostProtocol.ISuggestDataDtoField.insertText] = item.insertText.value;
result[extHostProtocol.ISuggestDataDtoField.insertTextRules]! |= modes.CompletionItemInsertTextRule.InsertAsSnippet;
}
// 'overwrite[Before|After]'-logic
@@ -757,7 +757,7 @@ class SuggestAdapter {
} else if (item.range) {
range = item.range;
}
result.j = typeConvert.Range.from(range);
result[extHostProtocol.ISuggestDataDtoField.range] = typeConvert.Range.from(range);
if (range && (!range.isSingleLine || range.start.line !== position.line)) {
console.warn('INVALID text edit -> must be single line and on the same line');

View File

@@ -62,7 +62,7 @@ export abstract class RequireInterceptor {
this.register(new SqlopsNodeModuleFactory(this._apiFactory.sqlops, extensionPaths)); // {{SQL CARBON EDIT}} // add node module
this.register(this._instaService.createInstance(KeytarNodeModuleFactory));
if (this._initData.remote.isRemote) {
this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths));
this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths, this._initData.environment.appUriScheme));
}
}
@@ -233,6 +233,7 @@ class OpenNodeModuleFactory implements INodeModuleFactory {
constructor(
private readonly _extensionPaths: TernarySearchTree<IExtensionDescription>,
private readonly _appUriScheme: string,
@IExtHostRpcService rpcService: IExtHostRpcService,
) {
@@ -247,7 +248,7 @@ class OpenNodeModuleFactory implements INodeModuleFactory {
}
if (uri.scheme === 'http' || uri.scheme === 'https') {
return mainThreadWindow.$openUri(uri, { allowTunneling: true });
} else if (uri.scheme === 'mailto') {
} else if (uri.scheme === 'mailto' || uri.scheme === this._appUriScheme) {
return mainThreadWindow.$openUri(uri, {});
}
return this.callOriginal(target, options);

View File

@@ -225,8 +225,8 @@ export namespace TaskDTO {
execution = ProcessExecutionDTO.from(value.execution);
} else if (value.execution instanceof types.ShellExecution) {
execution = ShellExecutionDTO.from(value.execution);
} else if ((<vscode.Task2>value).execution2 && (<vscode.Task2>value).execution2 instanceof types.CustomExecution) {
execution = CustomExecutionDTO.from(<types.CustomExecution>(<vscode.Task2>value).execution2);
} else if (value.execution && value.execution instanceof types.CustomExecution) {
execution = CustomExecutionDTO.from(<types.CustomExecution>value.execution);
}
const definition: tasks.TaskDefinitionDTO | undefined = TaskDefinitionDTO.from(value.definition);
@@ -261,6 +261,7 @@ export namespace TaskDTO {
problemMatchers: value.problemMatchers,
hasDefinedMatchers: (value as types.Task).hasDefinedMatchers,
runOptions: (<vscode.Task>value).runOptions ? (<vscode.Task>value).runOptions : { reevaluateOnRerun: true },
detail: (<vscode.Task2>value).detail
};
return result;
}
@@ -303,6 +304,9 @@ export namespace TaskDTO {
if (value._id) {
result._id = value._id;
}
if (value.detail) {
result.detail = value.detail;
}
return result;
}
}
@@ -574,7 +578,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
}
if (CustomExecutionDTO.is(resolvedTaskDTO.execution)) {
await this.addCustomExecution(resolvedTaskDTO, <vscode.Task2>resolvedTask, true);
await this.addCustomExecution(resolvedTaskDTO, resolvedTask, true);
}
return await this.resolveTaskInternal(resolvedTaskDTO);
@@ -588,12 +592,12 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
return this._handleCounter++;
}
protected async addCustomExecution(taskDTO: tasks.TaskDTO, task: vscode.Task2, isProvided: boolean): Promise<void> {
protected async addCustomExecution(taskDTO: tasks.TaskDTO, task: vscode.Task, isProvided: boolean): Promise<void> {
const taskId = await this._proxy.$createTaskId(taskDTO);
if (!isProvided && !this._providedCustomExecutions2.has(taskId)) {
this._notProvidedCustomExecutions.add(taskId);
}
this._providedCustomExecutions2.set(taskId, <types.CustomExecution>(<vscode.Task2>task).execution2);
this._providedCustomExecutions2.set(taskId, <types.CustomExecution>task.execution);
}
protected async getTaskExecution(execution: tasks.TaskExecutionDTO | string, task?: vscode.Task): Promise<TaskExecutionImpl> {
@@ -675,7 +679,7 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
// in the provided custom execution map that is cleaned up after the
// task is executed.
if (CustomExecutionDTO.is(dto.execution)) {
await this.addCustomExecution(dto, <vscode.Task2>task, false);
await this.addCustomExecution(dto, task, false);
} else {
throw new Error('Not implemented');
}
@@ -697,7 +701,7 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
// The ID is calculated on the main thread task side, so, let's call into it here.
// We need the task id's pre-computed for custom task executions because when OnDidStartTask
// is invoked, we have to be able to map it back to our data.
taskIdPromises.push(this.addCustomExecution(taskDTO, <vscode.Task2>task, true));
taskIdPromises.push(this.addCustomExecution(taskDTO, task, true));
} else {
console.warn('Only custom execution tasks supported.');
}

View File

@@ -1815,6 +1815,7 @@ export class Task implements vscode.Task2 {
private _group: TaskGroup | undefined;
private _presentationOptions: vscode.TaskPresentationOptions;
private _runOptions: vscode.RunOptions;
private _detail: string | undefined;
constructor(definition: vscode.TaskDefinition, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution, problemMatchers?: string | string[]);
constructor(definition: vscode.TaskDefinition, scope: vscode.TaskScope.Global | vscode.TaskScope.Workspace | vscode.WorkspaceFolder, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution, problemMatchers?: string | string[]);
@@ -1928,19 +1929,11 @@ export class Task implements vscode.Task2 {
this._name = value;
}
get execution(): ProcessExecution | ShellExecution | undefined {
return (this._execution instanceof CustomExecution) ? undefined : this._execution;
}
set execution(value: ProcessExecution | ShellExecution | undefined) {
this.execution2 = value;
}
get execution2(): ProcessExecution | ShellExecution | CustomExecution | undefined {
get execution(): ProcessExecution | ShellExecution | CustomExecution | undefined {
return this._execution;
}
set execution2(value: ProcessExecution | ShellExecution | CustomExecution | undefined) {
set execution(value: ProcessExecution | ShellExecution | CustomExecution | undefined) {
if (value === null) {
value = undefined;
}
@@ -2009,6 +2002,17 @@ export class Task implements vscode.Task2 {
this._group = value;
}
get detail(): string | undefined {
return this._detail;
}
set detail(value: string | undefined) {
if (value === null) {
value = undefined;
}
this._detail = value;
}
get presentationOptions(): vscode.TaskPresentationOptions {
return this._presentationOptions;
}

View File

@@ -89,6 +89,7 @@ export interface TaskDTO {
isBackground?: boolean;
source: TaskSourceDTO;
group?: string;
detail?: string;
presentationOptions?: TaskPresentationOptionsDTO;
problemMatchers: string[];
hasDefinedMatchers: boolean;

View File

@@ -57,7 +57,7 @@ export class ExtHostTask extends ExtHostTaskBase {
// in the provided custom execution map that is cleaned up after the
// task is executed.
if (CustomExecutionDTO.is(dto.execution)) {
await this.addCustomExecution(dto, <vscode.Task2>task, false);
await this.addCustomExecution(dto, task, false);
}
return this._proxy.$executeTask(dto).then(value => this.getTaskExecution(value, task));

View File

@@ -123,7 +123,7 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
this._variableResolver = new ExtHostVariableResolverService(workspaceFolders || [], this._extHostDocumentsAndEditors, configProvider);
}
public async $spawnExtHostProcess(id: number, shellLaunchConfigDto: IShellLaunchConfigDto, activeWorkspaceRootUriComponents: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): Promise<void> {
public async $spawnExtHostProcess(id: number, shellLaunchConfigDto: IShellLaunchConfigDto, activeWorkspaceRootUriComponents: UriComponents | undefined, cols: number, rows: number, isWorkspaceShellAllowed: boolean): Promise<void> {
const shellLaunchConfig: IShellLaunchConfig = {
name: shellLaunchConfigDto.name,
executable: shellLaunchConfigDto.executable,
@@ -156,16 +156,21 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
}
const activeWorkspaceRootUri = URI.revive(activeWorkspaceRootUriComponents);
// Get the environment
const apiLastActiveWorkspace = await this._extHostWorkspace.getWorkspaceFolder(activeWorkspaceRootUri);
const lastActiveWorkspace = apiLastActiveWorkspace ? {
uri: apiLastActiveWorkspace.uri,
name: apiLastActiveWorkspace.name,
index: apiLastActiveWorkspace.index,
toResource: () => {
throw new Error('Not implemented');
let lastActiveWorkspace: IWorkspaceFolder | null = null;
if (activeWorkspaceRootUriComponents && activeWorkspaceRootUri) {
// Get the environment
const apiLastActiveWorkspace = await this._extHostWorkspace.getWorkspaceFolder(activeWorkspaceRootUri);
if (apiLastActiveWorkspace) {
lastActiveWorkspace = {
uri: apiLastActiveWorkspace.uri,
name: apiLastActiveWorkspace.name,
index: apiLastActiveWorkspace.index,
toResource: () => {
throw new Error('Not implemented');
}
};
}
} as IWorkspaceFolder : null;
}
// Get the initial cwd
const terminalConfig = configProvider.getConfiguration('terminal.integrated');