Skip to content

bilelmoussaoui/flatpak-vscode

Repository files navigation

VSCode + Flatpak Integration

CI Visual Studio Marketplace Installs Matrix Chat

A simple VSCode extension that detects a Flatpak manifest and offers various commands to build, run, and export a bundle.

Download

Requirements

  • flatpak
  • flatpak-builder

If you're using Fedora Silverblue, it is recommended to install org.flatpak.Builder through flatpak install org.flatpak.Builder. However, layering flatpak-builder through rpm-ostree install flatpak-builder is still possible. The extension would use the host flatpak-builder by default and fallback to the flatpak-installed org.flatpak.Builder.

Commands

  • Build: Initialize a Flatpak build, update the dependencies & build them. It also does a first build of the application.
  • Build and Run: Build or rebuild the application then run it.
  • Stop: Stop the currently running task.
  • Run: Run the application.
  • Update Dependencies: Download/Update the dependencies and builds them.
  • Clean: Clean the Flatpak repo directory (.flatpak/repo) inside the current workspace.
  • Runtime Terminal: Spawn a new terminal inside the specified SDK.
  • Build Terminal: Spawn a new terminal inside the current build repository (Note that the SDKs used are automatically mounted and enabled as well).
  • Show Output Terminal: Show the output terminal of the build and run commands.
  • Show Data Directory: Show the data directory (~/.var/app/<application-id>) for the active manifest.
  • Select Manifest: Select or change the active manifest.

Integrations

Other extensions like rust-analyzer and vala mostly works better if it integrates with the Flatpak runtime. Some integrations may prevent rebuilds or requiring to install dependencies in the host. If you want to contribute on adding an integration, see CONTRIBUTING.

  • Overrides mesonbuild.configureOnOpen to not ask to configure the build directory; this should be handled by Flatpak.
  • Overrides mesonbuild.buildFolder to use the build directory used by Flatpak.
  • Overrides mesonbuild.mesonPath to use the meson binary from the SDK.
  • Overrides rust-analyzer.server.path and rust-analyzer.runnables.command to use the SDK's rust-analyzer and cargo binaries respectively. This is to avoid requiring build dependencies to be installed in the host.
  • Overrides rust-analyzer.files.excludeDirs to set rust-analyzer to ignore .flatpak folder.
  • Overrides vala.languageServerPath to use the SDK's Vala Language Server.

Contributing

Click here to find out how to contribute.