sublimelsp / lsp_utils

Module with LSP-related utilities for Sublime Text
https://sublimelsp.github.io/lsp_utils/
MIT License
16 stars 6 forks source link

Is it possible to replace node with bun? #119

Open lpite opened 6 months ago

jfcherng commented 6 months ago

I had a bad experience with it on Windows. https://github.com/DetachHead/basedpyright/issues/60#issuecomment-2041983954

Doubt how good it is on other platform.

Jarred-Sumner commented 6 months ago

Our Windows support is definitely worse than Linux/Mac.

lpite commented 6 months ago

On macOS bun works fine so I just curious if that's possible.

jfcherng commented 6 months ago

More of a "worth it or not" question. I don't think the user should care what runtime is used if it's managed by lsp_utils. If Bun can't beat Electron (speed or used RAM), I see no point to use it.

jfcherng commented 6 months ago

But if you want to use a non-lsp-managed Bun for servers and you have node installed... You can change the CLI command to invoke the server in server settings. The node version check is still required at this moment...

I feel the major issue is the Node.js version restriction specified in LSP-* plugins.

lpite commented 6 months ago

More of a "worth it or not" question. I don't think the user should care what runtime is used if it's managed by lsp_utils. If Bun can't beat Electron (speed or used RAM), I see no point to use it.

In case of speed it faster but in RAM i don't see any major difference

jfcherng commented 6 months ago

Found some benchmark on non-Windows. It's pretty appealing indeed. Not sure how to integrate Bun into lsp_utils though. Currently, all nodejs-based LSP-* just inherits NpmClientHandler and they can specify a nodejs version range which the server supports.

If the user doesn't want to use lsp_utils-managed JS runtime, lsp_utils would have to find node/bun from PATH. The possible combination becomes

It looks like the best is to use Electron on Windows and Bun on others.