-
Notifications
You must be signed in to change notification settings - Fork 354
Rearchitect LSP: separate main/worker processes for compilation #4182
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
Open
kugesan1105
wants to merge
39
commits into
jaseci-labs:main
Choose a base branch
from
kugesan1105:lsp_scheduler_infrastructure
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rearchitect LSP: separate main/worker processes for compilation #4182
kugesan1105
wants to merge
39
commits into
jaseci-labs:main
from
kugesan1105:lsp_scheduler_infrastructure
+2,730
−1,165
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… background compilation - Added `ProgramSnapshot` and `SnapshotManager` for non-blocking LSP queries. - Introduced `WorkerManager` and `CompilationWorker` for handling background compilation tasks. - Implemented inter-process communication (IPC) protocol for worker communication. - Added synchronization primitives including `RWLock` and `AnalysisGate` for thread safety. - Enhanced `JacLangServer` to handle file open, save, change, and close events with scheduling for analysis. - Created `AnalysisScheduler` to manage user activity backoff and prioritize analysis tasks. - Added support for cancellation of in-flight compilation requests. - Implemented error handling and logging for worker processes.
1 task
- Refactor JacLangServer to utilize a scheduler for analysis, improving responsiveness and allowing for cancellation of requests. - Introduce a LockManager for thread-safe access to shared resources. - Enhance logging capabilities for better debugging and monitoring. - Implement health checks for the worker process to ensure reliability and automatic recovery from crashes. - Add support for cancellation of in-flight requests, improving user experience during rapid typing. - Update serialization of ProgramSnapshot to handle deep AST structures by temporarily increasing the recursion limit. - Create a test script to reproduce and validate the pickle recursion issue with AST nodes.
…heduler with debounce mechanism
…and simplify architecture
…itions for clarity
…and responsiveness - Updated LSP server to use intelligent debounce scheduling and foreground request handling. - Removed unused snapshot management code to streamline IPC and reduce overhead. - Enhanced worker process to handle both compilation and foreground LSP requests, minimizing IPC overhead. - Introduced new methods for handling various LSP requests (hover, definition, etc.) directly in the worker. - Simplified file change handling to only analyze on save, improving responsiveness during rapid edits. - Added new utility functions for generating diagnostics from a dictionary. - Updated test fixture to include additional spacing for clarity.
…nd performance; enhance type checking and analysis scheduling
Collaborator
Author
Both
|
…re; streamline LSP request handling and enhance response utilities
…t code and improve clarity
…nd improve code clarity
… to get the error and warning for jaclang core files
…r program and semantic managers
for more information, see https://pre-commit.ci
…er communication - Removed JacLangServer and Workspace dependencies from test utilities. - Introduced LspTestClient to simulate LSP two-process architecture. - Updated tests to utilize LspTestClient for compiling files and making requests. - Simplified hover, definition, and completion assertions using the new client. - Cleaned up test setup and teardown processes to manage client lifecycle.
…n and add TODO for symbol resolution refactor in tests
cf003d2 to
29f8e4d
Compare
5097850 to
f73a605
Compare
for more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds multiprocessing worker for GIL-free compilation, scheduler with
priority queueanddebouncing.Notes