💄
This commit is contained in:
parent
e1373b367d
commit
b57190f449
|
@ -74,29 +74,29 @@ export default class TscTaskProvider implements vscode.TaskProvider {
|
||||||
|
|
||||||
public async resolveTask(task: vscode.Task): Promise<vscode.Task | undefined> {
|
public async resolveTask(task: vscode.Task): Promise<vscode.Task | undefined> {
|
||||||
const definition = <TypeScriptTaskDefinition>task.definition;
|
const definition = <TypeScriptTaskDefinition>task.definition;
|
||||||
const badTsconfig = /\\tsconfig.*\.json/;
|
if (/\\tsconfig.*\.json/.test(definition.tsconfig)) {
|
||||||
if (badTsconfig.test(definition.tsconfig)) {
|
|
||||||
// Warn that the task has the wrong slash type
|
// Warn that the task has the wrong slash type
|
||||||
vscode.window.showWarningMessage(localize('badTsConfig', "TypeScript Task in tasks.json contains \"\\\\\". TypeScript tasks tsconfig must use \"/\""));
|
vscode.window.showWarningMessage(localize('badTsConfig', "TypeScript Task in tasks.json contains \"\\\\\". TypeScript tasks tsconfig must use \"/\""));
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const typescriptTask = definition.tsconfig;
|
const tsconfigPath = definition.tsconfig;
|
||||||
if (typescriptTask) {
|
if (!tsconfigPath) {
|
||||||
if (task.scope === undefined || task.scope === vscode.TaskScope.Global || task.scope === vscode.TaskScope.Workspace) {
|
return undefined;
|
||||||
// scope is required to be a WorkspaceFolder for resolveTask
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const tsconfigUri: vscode.Uri = task.scope.uri.with({ path: task.scope.uri.path + '/' + definition.tsconfig });
|
|
||||||
const tsconfig: TSConfig = {
|
|
||||||
uri: tsconfigUri,
|
|
||||||
fsPath: tsconfigUri.fsPath,
|
|
||||||
posixPath: tsconfigUri.path,
|
|
||||||
workspaceFolder: task.scope
|
|
||||||
};
|
|
||||||
return this.getTasksForProjectAndDefinition(tsconfig, definition);
|
|
||||||
}
|
}
|
||||||
return undefined;
|
|
||||||
|
if (task.scope === undefined || task.scope === vscode.TaskScope.Global || task.scope === vscode.TaskScope.Workspace) {
|
||||||
|
// scope is required to be a WorkspaceFolder for resolveTask
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const tsconfigUri = task.scope.uri.with({ path: task.scope.uri.path + '/' + tsconfigPath });
|
||||||
|
const tsconfig: TSConfig = {
|
||||||
|
uri: tsconfigUri,
|
||||||
|
fsPath: tsconfigUri.fsPath,
|
||||||
|
posixPath: tsconfigUri.path,
|
||||||
|
workspaceFolder: task.scope
|
||||||
|
};
|
||||||
|
return this.getTasksForProjectAndDefinition(tsconfig, definition);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getAllTsConfigs(token: vscode.CancellationToken): Promise<TSConfig[]> {
|
private async getAllTsConfigs(token: vscode.CancellationToken): Promise<TSConfig[]> {
|
||||||
|
|
Loading…
Reference in a new issue