Skip to content

Commit

Permalink
Support add/remove imported projects (#3398)
Browse files Browse the repository at this point in the history
- Reuse the 'BuildFilesSelector' and enable change the imported
  projects after the activation finishes.
---------

Signed-off-by: Sheng Chen <[email protected]>
  • Loading branch information
jdneo authored Nov 29, 2023
1 parent 505fbe7 commit aea6d6f
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 134 deletions.
7 changes: 7 additions & 0 deletions src/apiManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ApiManager {
private onDidClasspathUpdateEmitter: Emitter<Uri> = new Emitter<Uri>();
private onDidServerModeChangeEmitter: Emitter<ServerMode> = new Emitter<ServerMode>();
private onDidProjectsImportEmitter: Emitter<Uri[]> = new Emitter<Uri[]>();
private onDidProjectsDeleteEmitter: Emitter<Uri[]> = new Emitter<Uri[]>();
private traceEventEmitter: Emitter<any> = new Emitter<any>();
private sourceInvalidatedEventEmitter: Emitter<SourceInvalidatedEvent> = new Emitter<SourceInvalidatedEvent>();
private serverReadyPromiseResolve: (result: boolean) => void;
Expand Down Expand Up @@ -46,6 +47,7 @@ class ApiManager {
const onDidClasspathUpdate = this.onDidClasspathUpdateEmitter.event;
const onDidServerModeChange = this.onDidServerModeChangeEmitter.event;
const onDidProjectsImport = this.onDidProjectsImportEmitter.event;
const onDidProjectsDelete = this.onDidProjectsDeleteEmitter.event;
const traceEvent = this.traceEventEmitter.event;

const serverReadyPromise: Promise<boolean> = new Promise<boolean>((resolve) => {
Expand All @@ -69,6 +71,7 @@ class ApiManager {
serverMode,
onDidServerModeChange,
onDidProjectsImport,
onDidProjectsDelete,
serverReady,
onWillRequestStart,
onDidRequestEnd,
Expand Down Expand Up @@ -97,6 +100,10 @@ class ApiManager {
this.onDidProjectsImportEmitter.fire(event);
}

public fireDidProjectsDelete(event: Uri[]): void {
this.onDidProjectsDeleteEmitter.fire(event);
}

public fireTraceEvent(event: any): void {
this.traceEventEmitter.fire(event);
}
Expand Down
Loading

0 comments on commit aea6d6f

Please sign in to comment.