mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fixes #34966: Task list doesn't update when gulp, grunt or jake file changes.
This commit is contained in:
parent
67b5612353
commit
643e569a6e
|
@ -205,7 +205,6 @@ class TaskDetector {
|
|||
|
||||
private taskProvider: vscode.Disposable | undefined;
|
||||
private detectors: Map<string, FolderDetector> = new Map();
|
||||
private promise: Promise<vscode.Task[]> | undefined;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
@ -225,15 +224,12 @@ class TaskDetector {
|
|||
this.taskProvider = undefined;
|
||||
}
|
||||
this.detectors.clear();
|
||||
this.promise = undefined;
|
||||
}
|
||||
|
||||
private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
|
||||
let changed = false;
|
||||
for (let remove of removed) {
|
||||
let detector = this.detectors.get(remove.uri.toString());
|
||||
if (detector) {
|
||||
changed = true;
|
||||
detector.dispose();
|
||||
this.detectors.delete(remove.uri.toString());
|
||||
}
|
||||
|
@ -241,22 +237,16 @@ class TaskDetector {
|
|||
for (let add of added) {
|
||||
let detector = new FolderDetector(add);
|
||||
if (detector.isEnabled()) {
|
||||
changed = true;
|
||||
this.detectors.set(add.uri.toString(), detector);
|
||||
detector.start();
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
this.promise = undefined;
|
||||
}
|
||||
this.updateProvider();
|
||||
}
|
||||
|
||||
private updateConfiguration(): void {
|
||||
let changed = false;
|
||||
for (let detector of this.detectors.values()) {
|
||||
if (!detector.isEnabled()) {
|
||||
changed = true;
|
||||
detector.dispose();
|
||||
this.detectors.delete(detector.workspaceFolder.uri.toString());
|
||||
}
|
||||
|
@ -267,16 +257,12 @@ class TaskDetector {
|
|||
if (!this.detectors.has(folder.uri.toString())) {
|
||||
let detector = new FolderDetector(folder);
|
||||
if (detector.isEnabled()) {
|
||||
changed = true;
|
||||
this.detectors.set(folder.uri.toString(), detector);
|
||||
detector.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
this.promise = undefined;
|
||||
}
|
||||
this.updateProvider();
|
||||
}
|
||||
|
||||
|
@ -294,15 +280,11 @@ class TaskDetector {
|
|||
else if (this.taskProvider && this.detectors.size === 0) {
|
||||
this.taskProvider.dispose();
|
||||
this.taskProvider = undefined;
|
||||
this.promise = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
public getTasks(): Promise<vscode.Task[]> {
|
||||
if (!this.promise) {
|
||||
this.promise = this.computeTasks();
|
||||
}
|
||||
return this.promise;
|
||||
return this.computeTasks();
|
||||
}
|
||||
|
||||
private computeTasks(): Promise<vscode.Task[]> {
|
||||
|
|
|
@ -177,7 +177,6 @@ class TaskDetector {
|
|||
|
||||
private taskProvider: vscode.Disposable | undefined;
|
||||
private detectors: Map<string, FolderDetector> = new Map();
|
||||
private promise: Promise<vscode.Task[]> | undefined;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
@ -197,15 +196,12 @@ class TaskDetector {
|
|||
this.taskProvider = undefined;
|
||||
}
|
||||
this.detectors.clear();
|
||||
this.promise = undefined;
|
||||
}
|
||||
|
||||
private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
|
||||
let changed = false;
|
||||
for (let remove of removed) {
|
||||
let detector = this.detectors.get(remove.uri.toString());
|
||||
if (detector) {
|
||||
changed = true;
|
||||
detector.dispose();
|
||||
this.detectors.delete(remove.uri.toString());
|
||||
}
|
||||
|
@ -213,22 +209,16 @@ class TaskDetector {
|
|||
for (let add of added) {
|
||||
let detector = new FolderDetector(add);
|
||||
if (detector.isEnabled()) {
|
||||
changed = true;
|
||||
this.detectors.set(add.uri.toString(), detector);
|
||||
detector.start();
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
this.promise = undefined;
|
||||
}
|
||||
this.updateProvider();
|
||||
}
|
||||
|
||||
private updateConfiguration(): void {
|
||||
let changed = false;
|
||||
for (let detector of this.detectors.values()) {
|
||||
if (!detector.isEnabled()) {
|
||||
changed = true;
|
||||
detector.dispose();
|
||||
this.detectors.delete(detector.workspaceFolder.uri.toString());
|
||||
}
|
||||
|
@ -239,16 +229,12 @@ class TaskDetector {
|
|||
if (!this.detectors.has(folder.uri.toString())) {
|
||||
let detector = new FolderDetector(folder);
|
||||
if (detector.isEnabled()) {
|
||||
changed = true;
|
||||
this.detectors.set(folder.uri.toString(), detector);
|
||||
detector.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
this.promise = undefined;
|
||||
}
|
||||
this.updateProvider();
|
||||
}
|
||||
|
||||
|
@ -266,15 +252,11 @@ class TaskDetector {
|
|||
else if (this.taskProvider && this.detectors.size === 0) {
|
||||
this.taskProvider.dispose();
|
||||
this.taskProvider = undefined;
|
||||
this.promise = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
public getTasks(): Promise<vscode.Task[]> {
|
||||
if (!this.promise) {
|
||||
this.promise = this.computeTasks();
|
||||
}
|
||||
return this.promise;
|
||||
return this.computeTasks();
|
||||
}
|
||||
|
||||
private computeTasks(): Promise<vscode.Task[]> {
|
||||
|
|
|
@ -182,7 +182,6 @@ class TaskDetector {
|
|||
|
||||
private taskProvider: vscode.Disposable | undefined;
|
||||
private detectors: Map<string, FolderDetector> = new Map();
|
||||
private promise: Promise<vscode.Task[]> | undefined;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
@ -202,15 +201,12 @@ class TaskDetector {
|
|||
this.taskProvider = undefined;
|
||||
}
|
||||
this.detectors.clear();
|
||||
this.promise = undefined;
|
||||
}
|
||||
|
||||
private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
|
||||
let changed = false;
|
||||
for (let remove of removed) {
|
||||
let detector = this.detectors.get(remove.uri.toString());
|
||||
if (detector) {
|
||||
changed = true;
|
||||
detector.dispose();
|
||||
this.detectors.delete(remove.uri.toString());
|
||||
}
|
||||
|
@ -218,22 +214,16 @@ class TaskDetector {
|
|||
for (let add of added) {
|
||||
let detector = new FolderDetector(add);
|
||||
if (detector.isEnabled()) {
|
||||
changed = true;
|
||||
this.detectors.set(add.uri.toString(), detector);
|
||||
detector.start();
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
this.promise = undefined;
|
||||
}
|
||||
this.updateProvider();
|
||||
}
|
||||
|
||||
private updateConfiguration(): void {
|
||||
let changed = false;
|
||||
for (let detector of this.detectors.values()) {
|
||||
if (!detector.isEnabled()) {
|
||||
changed = true;
|
||||
detector.dispose();
|
||||
this.detectors.delete(detector.workspaceFolder.uri.toString());
|
||||
}
|
||||
|
@ -244,16 +234,12 @@ class TaskDetector {
|
|||
if (!this.detectors.has(folder.uri.toString())) {
|
||||
let detector = new FolderDetector(folder);
|
||||
if (detector.isEnabled()) {
|
||||
changed = true;
|
||||
this.detectors.set(folder.uri.toString(), detector);
|
||||
detector.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
this.promise = undefined;
|
||||
}
|
||||
this.updateProvider();
|
||||
}
|
||||
|
||||
|
@ -271,15 +257,11 @@ class TaskDetector {
|
|||
else if (this.taskProvider && this.detectors.size === 0) {
|
||||
this.taskProvider.dispose();
|
||||
this.taskProvider = undefined;
|
||||
this.promise = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
public getTasks(): Promise<vscode.Task[]> {
|
||||
if (!this.promise) {
|
||||
this.promise = this.computeTasks();
|
||||
}
|
||||
return this.promise;
|
||||
return this.computeTasks();
|
||||
}
|
||||
|
||||
private computeTasks(): Promise<vscode.Task[]> {
|
||||
|
|
Loading…
Reference in a new issue