graph LR
LSP_Communication_Core["LSP Communication Core"]
Ruff_Process_Manager["Ruff Process Manager"]
LSP_Communication_Core -- "orchestrates" --> Ruff_Process_Manager
Ruff_Process_Manager -- "returns results to" --> LSP_Communication_Core
click LSP_Communication_Core href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/ruff-lsp/LSP_Communication_Core.md" "Details"
The ruff-lsp project is structured around two primary architectural components: the LSP Communication Core and the Ruff Process Manager. The LSP Communication Core acts as the central interface for all Language Server Protocol interactions, handling incoming requests from the client, dispatching them to appropriate handlers, and managing the server's lifecycle. It is responsible for parsing LSP messages, maintaining document states, and sending responses and notifications. Complementing this, the Ruff Process Manager is dedicated to abstracting and managing the execution of Ruff commands as an external process. It handles the invocation of the Ruff binary, manages its input/output streams, and ensures efficient execution of linting, formatting, and other Ruff-related operations. The LSP Communication Core orchestrates the Ruff Process Manager to perform code analysis and fixes, with the results being returned to the LSP Communication Core for onward transmission to the LSP client. This clear separation of concerns allows for robust LSP communication and efficient, isolated execution of Ruff functionalities.
LSP Communication Core [Expand]
The central hub for all Language Server Protocol (LSP) interactions. It manages the server's lifecycle, parses incoming LSP requests, dispatches them to appropriate handlers, and sends responses and notifications back to the LSP client. This component embodies the core client-server communication pattern inherent in LSP.
Related Classes/Methods:
ruff_lsp.server:initializeruff_lsp.server:did_openruff_lsp.server:did_changeruff_lsp.server:hoverruff_lsp.server:code_actionruff_lsp.server:format_documentruff_lsp.server:_run_subcommand_on_documentruff_lsp.server:_lint_document_implruff_lsp.server:_fix_document_implruff_lsp.server:_format_document_implruff_lsp.server:from_text_documentruff_lsp.server:from_cell_or_text_uriruff_lsp.server:_update_workspace_settingsruff_lsp.server:_get_global_defaultsruff_lsp.server:_get_settings_by_document
Manages the execution of Ruff commands as an external process and retrieves their results. It abstracts the details of invoking Ruff, handling its input/output streams, and ensuring efficient execution.
Related Classes/Methods: