flathub / org.freedesktop.Sdk.Extension.node18

https://flathub.org/apps/details/org.freedesktop.Sdk.Extension.node18
3 stars 3 forks source link

Language Server Support #19

Open chergert opened 1 year ago

chergert commented 1 year ago

I wanted to see if there is any chance on movement to include an LSP for node within the SDK? We've increasingly been doing that in the other SDK extensions with great success as it significantly reduces the friction to get new developers setup within IDEs (to basically a no-op).

Coincidentally, I'm going to stop bundling fallback LSPs as part of GNOME Builder and so it will be either up to projects to bundle LSP in their node configurations, or we can make it turn-key if we have it in the SDK extension.

gasinvein commented 1 year ago

Can you please reiterate what exactly do we need to have a nodejs LSP in the SDK extension?

chergert commented 1 year ago

Probably just installing typescript-language-server into the SDK and either place it in /usr/lib/sdk/node18/bin or another place where we can "append-path" in application manifest.

gasinvein commented 1 year ago

If it's a standalone binary, I guess bundling it shouldn't be more difficult than any nodejs-based project. However, the nodejs SDK extensions are versioned (node12, node14, etc). How do we handle this, assuming that we don't want to bundle the LSP for every major nodejs version?

gasinvein commented 1 year ago

Ugh, I've looked into it and learned that there is no Yarn equivalent of npm install -g . yarnpkg/yarn#3256 Bundling typescript-language-server, which is Yarn-based, may be tricky.

chergert commented 1 year ago

However, the nodejs SDK extensions are versioned (node12, node14, etc). How do we handle this, assuming that we don't want to bundle the LSP for every major nodejs version?

You would want it bundled per-SDK variant, as that ensures everything is working with that specific toolchain. We do the same for rust-stable vs rust-nightly and all the LLVM extensions (with clangd).

gasinvein commented 1 year ago

You would want it bundled per-SDK variant, as that ensures everything is working with that specific toolchain. We do the same for rust-stable vs rust-nightly and all the LLVM extensions (with clangd).

Yeah, but there are only two rust SDK extensions, while a new nodejs lts version is released every year (and we have 5 of them on Flathub already). Maybe we can make an "unversioned" (always-latest) node SDK extension and bundle the language server only there?

chergert commented 1 year ago

I think a development version makes sense, from a development standpoint. We do that for gnome too. It might be a bit complicated from flathub standpoint though, not sure our policy on unversioned things yet outside of beta.

maybe @ramcq or @nedrichards would have a suggestion.

orowith2os commented 1 year ago

Probably just installing typescript-language-server into the SDK and either place it in /usr/lib/sdk/node18/bin or another place where we can "append-path" in application manifest.

This is in the org.freedesktop.Sdk.Extension.typescript package now.

chergert commented 1 year ago

This is in the org.freedesktop.Sdk.Extension.typescript package now.

Thanks, I have some updates we can push soon for Builder to use it w/ JS projects.