Skip to content

Refactor UDP communication out into transport class#35

Open
dannyZyg wants to merge 1 commit intoscztt:developfrom
dannyZyg:provide-interchangeable-lsp-transports
Open

Refactor UDP communication out into transport class#35
dannyZyg wants to merge 1 commit intoscztt:developfrom
dannyZyg:provide-interchangeable-lsp-transports

Conversation

@dannyZyg
Copy link
Copy Markdown

@dannyZyg dannyZyg commented Apr 6, 2026

Extracts all UDP specific functionality into a transport class that could be swapped out for stdio, or anything else.

As mentioned in your comment here, it would be great for sclang to support stdio for LSP.

I've been looking into sclang stdio compatibility for LSP usage, and while there are a bunch of things to consider on the sclang side, this might be the small first step towards compatibility on the quark side of things.

A couple of chunks that would need to be completed:

  • LanguageServer.quark to support multiple transport styles, convert UDP to new structure (this PR)
  • LanguageServer.quark to support stdio (add another transport class like the one in this PR)
  • sclang to reroute stdout elsewhere (e.g. log file) when in LSP mode
  • sclang to provide streaming stdin for LS (currently it looks like the stdin thread is limited to REPL use)

If this is completely off the mark please let me know and I'd be happy to have another crack at it.

Extracts all UDP specific functionality into a transport class
that could be swapped out for stdio, or anything else.
Comment thread LSP.sc
Comment on lines +89 to +96
Routine({
this.transport.start(this);

// @TODO Is this the only "default" provider we want?
this.addProvider(InitializeProvider(this, {}));

readyMsg.postln;
}).play(AppClock);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a preferred approach here? This is blocking as I understand, which could be a problem.

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.

1 participant