Skip to content

Commit aea6d6f

Browse files
authored
Support add/remove imported projects (#3398)
- Reuse the 'BuildFilesSelector' and enable change the imported projects after the activation finishes. --------- Signed-off-by: Sheng Chen <[email protected]>
1 parent 505fbe7 commit aea6d6f

File tree

9 files changed

+292
-134
lines changed

9 files changed

+292
-134
lines changed

src/apiManager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ApiManager {
1818
private onDidClasspathUpdateEmitter: Emitter<Uri> = new Emitter<Uri>();
1919
private onDidServerModeChangeEmitter: Emitter<ServerMode> = new Emitter<ServerMode>();
2020
private onDidProjectsImportEmitter: Emitter<Uri[]> = new Emitter<Uri[]>();
21+
private onDidProjectsDeleteEmitter: Emitter<Uri[]> = new Emitter<Uri[]>();
2122
private traceEventEmitter: Emitter<any> = new Emitter<any>();
2223
private sourceInvalidatedEventEmitter: Emitter<SourceInvalidatedEvent> = new Emitter<SourceInvalidatedEvent>();
2324
private serverReadyPromiseResolve: (result: boolean) => void;
@@ -46,6 +47,7 @@ class ApiManager {
4647
const onDidClasspathUpdate = this.onDidClasspathUpdateEmitter.event;
4748
const onDidServerModeChange = this.onDidServerModeChangeEmitter.event;
4849
const onDidProjectsImport = this.onDidProjectsImportEmitter.event;
50+
const onDidProjectsDelete = this.onDidProjectsDeleteEmitter.event;
4951
const traceEvent = this.traceEventEmitter.event;
5052

5153
const serverReadyPromise: Promise<boolean> = new Promise<boolean>((resolve) => {
@@ -69,6 +71,7 @@ class ApiManager {
6971
serverMode,
7072
onDidServerModeChange,
7173
onDidProjectsImport,
74+
onDidProjectsDelete,
7275
serverReady,
7376
onWillRequestStart,
7477
onDidRequestEnd,
@@ -97,6 +100,10 @@ class ApiManager {
97100
this.onDidProjectsImportEmitter.fire(event);
98101
}
99102

103+
public fireDidProjectsDelete(event: Uri[]): void {
104+
this.onDidProjectsDeleteEmitter.fire(event);
105+
}
106+
100107
public fireTraceEvent(event: any): void {
101108
this.traceEventEmitter.fire(event);
102109
}

0 commit comments

Comments
 (0)