vala-language-server icon indicating copy to clipboard operation
vala-language-server copied to clipboard

flatpak

Open Prince781 opened this issue 6 years ago • 8 comments

We should look at making a flatpak as an extension to the freedesktop Sdk, which should get VLS to work with Flatpaks for VSCode and other IDEs.

Prince781 avatar Apr 26 '20 15:04 Prince781

Maybe it'd be easier to just have users install vala-language-server via their distro and then have something like this where the VSCode flatpak has access:

#!/bin/sh

flatpak-spawn --host vala-language-server

I have this stored in $HOME/.bin/vscode/vala-language-server and then set the VSCode Vala Plugin to start vls from that executable and that works just as expected, but is able to access the host's VAPIs.

Cogitri avatar Jun 30 '20 12:06 Cogitri

@Cogitri did you mean to say, "but is not able to access the host's VAPIs?"

Prince781 avatar Jul 01 '20 12:07 Prince781

No, it's running on the host, so it uses the host's VAPIs, available packages etc. IMHO this is favourable over having vls use the Flatpak environment though, since it's pretty hard to install additonal packages in a flatpak compared to installing them via the user's distro package manager.

Cogitri avatar Jul 01 '20 12:07 Cogitri

Fedora Silverblue user here. Tried to create a Flatpak extension for VS Code specifically time ago, but failed building libgee. Then I created a standalone Flatpak package with the org.gnome.Sdk and it worked (with a few modifications on the VS Code extension), but it can't be expanded with more libraries and VLS currently lacks support for meson subprojects, so not really useful

I think I good idea may be to have VLS installed via Toolbox, and provide to the VS Code extension a way to run flatpak-spawn --host toolbox run vala-language-server if on Flatpak or just toolbox run vala-language-server if on regular VS Code

nyx-lyb3ra avatar Sep 24 '20 13:09 nyx-lyb3ra

Maybe it'd be easier to just have users install vala-language-server via their distro and then have something like this where the VSCode flatpak has access:

#!/bin/sh

flatpak-spawn --host vala-language-server

I have this stored in $HOME/.bin/vscode/vala-language-server and then set the VSCode Vala Plugin to start vls from that executable and that works just as expected, but is able to access the host's VAPIs.

@Cogitri can you elaborate how exactly you managed to successfully auto-start Vala Language Server from a VSCode Flatpak? In my case, I'm always getting a "Starting client failed Launching server using command $HOME/.bin/vala-language-server.sh failed" error. I did set things up as documented here: https://linux.marco.betschart.name/Desktop/Visual-Studio-Code-Vala-Autocompletion.html#setup-vala-autocompletion

marbetschar avatar Oct 19 '20 09:10 marbetschar

I have set this up as following:

  1. Created a vala-language-server script in $HOME/.bin/vscode/vala-language-server (any location will do though) with the following contents:
#!/bin/sh

flatpak-spawn --host vala-language-server "$@"
  1. chmod +x vala-language-server
  2. Added "vls.languageServerPath": "/home/rasmus/.bin/vscode/vala-language-server" to VSCode's settings.json. I think VSCode doesn't lookup the $HOME variable so that might be why it fails to startup VLS.

Cogitri avatar Oct 19 '20 11:10 Cogitri

@Cogitri thank you so much!! the hint regarding replacing the environment var with its actual value did the trick.

marbetschar avatar Oct 19 '20 18:10 marbetschar

For users of the flatpaked version of VS Code (and immutable systems), I found this article yesterday: https://jurf.github.io/2020/03/24/vscode-toolbox

After configuring everything as the article indicates, you simply install VLS in the Toolbox and the Vala extension should be able to detect it.

An issue related to this could be microsoft/vscode-remote-release#3345

nyx-lyb3ra avatar Oct 21 '20 17:10 nyx-lyb3ra

There is now a flatpak Sdk extension. This can be closed.

lw64 avatar Oct 08 '22 12:10 lw64

Right. Thanks.

Prince781 avatar Oct 08 '22 20:10 Prince781