-
Notifications
You must be signed in to change notification settings - Fork 83
feat: launch one remote workspace for all workspace folders #1348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9b620ad
092ccfe
9f9903b
5f4ee34
ae301e2
0fa8696
6e56dee
1e9e12d
d12b158
64dad74
97c7b30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ export class DependencyDiscoverer { | |
| private workspaceFolders: WorkspaceFolder[] | ||
| public dependencyHandlerRegistry: LanguageDependencyHandler<BaseDependencyInfo>[] = [] | ||
| private initializedWorkspaceFolder = new Map<WorkspaceFolder, boolean>() | ||
| // Create a SharedArrayBuffer with 4 bytes (for a 32-bit unsigned integer) for thread-safe counter | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for posterity, I believe we don't need to go with this approach since we are not using any workers or threads in the code and everything is single threaded at the moment a simple data type like the following would also work here The current approach is still fine and I am not suggesting we change it. |
||
| protected dependencyUploadedSizeSum = new Uint32Array(new SharedArrayBuffer(4)) | ||
|
|
||
| constructor( | ||
| workspace: Workspace, | ||
|
|
@@ -21,6 +23,7 @@ export class DependencyDiscoverer { | |
| ) { | ||
| this.workspaceFolders = workspaceFolders | ||
| this.logging = logging | ||
| this.dependencyUploadedSizeSum[0] = 0 | ||
|
|
||
| let jstsHandlerCreated = false | ||
| supportedWorkspaceContextLanguages.forEach(language => { | ||
|
|
@@ -29,7 +32,8 @@ export class DependencyDiscoverer { | |
| workspace, | ||
| logging, | ||
| workspaceFolders, | ||
| artifactManager | ||
| artifactManager, | ||
| this.dependencyUploadedSizeSum | ||
| ) | ||
| if (handler) { | ||
| // Share handler for javascript and typescript | ||
|
|
@@ -130,6 +134,13 @@ export class DependencyDiscoverer { | |
| this.logging.log(`Dependency search completed successfully`) | ||
| } | ||
|
|
||
| async reSyncDependenciesToS3(folders: WorkspaceFolder[]) { | ||
| Atomics.store(this.dependencyUploadedSizeSum, 0, 0) | ||
| for (const dependencyHandler of this.dependencyHandlerRegistry) { | ||
| await dependencyHandler.zipDependencyMap(folders) | ||
| } | ||
| } | ||
|
|
||
| async handleDependencyUpdateFromLSP(language: string, paths: string[], workspaceRoot?: WorkspaceFolder) { | ||
| for (const dependencyHandler of this.dependencyHandlerRegistry) { | ||
| if (dependencyHandler.language != language) { | ||
|
|
@@ -144,6 +155,7 @@ export class DependencyDiscoverer { | |
| this.dependencyHandlerRegistry.forEach(dependencyHandler => { | ||
| dependencyHandler.dispose() | ||
| }) | ||
| Atomics.store(this.dependencyUploadedSizeSum, 0, 0) | ||
| } | ||
|
|
||
| public disposeWorkspaceFolder(workspaceFolder: WorkspaceFolder) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder that debug logs are disabled by default on production
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, not seeing these messages valuable to present in user logs.