Skip to content

refactor: separate LSP options from transport#52

Open
matan-h wants to merge 1 commit intoheckmon:mainfrom
matan-h:lsp-options
Open

refactor: separate LSP options from transport#52
matan-h wants to merge 1 commit intoheckmon:mainfrom
matan-h:lsp-options

Conversation

@matan-h
Copy link

@matan-h matan-h commented Mar 9, 2026

This PR separates LSP configuration from transport handling.

Previously LspStdioConfig and LspSocketConfig were responsible for both LSP options and creating and managing the transport. adding a new option (e.g. initializationOptions) required updating both classes.

Now, they are separate them into clear classes:

  • LspConfig - LSP protocol
  • LspTransport - Transport parsing, either byte parsing, or WS

With that, it didn't make sense to create the Process,or WebSocketChannel directly in LspConfig, so I keep them in shortcut classes, named LspStdioConfig and LspSocketConfig to not break compatibility.

Changes:

  • Added LspTransport abstract class, with StdioTransport and SocketTransport implementing it
  • Make LspConfig able to work with any transport.
  • Allow users to supply their own process/websocket or new transport
  • Add initializationOptions option

@heckmon
Copy link
Owner

heckmon commented Mar 9, 2026

I'll review this PR after my exams👍👍. Currently I'm very busy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants