-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No syntax highlighting in Flatpak version #8
Comments
This flatpak doesn't ship the tree sitter grammars, instead relying on helix's |
I'll check that next time i am using debian, thanks. |
Works well, thanks for letting me know of this feature. Mentioned it in the Helix repo as well for those who have same issue: helix-editor/helix#7161 (comment) |
Why not ship with the grammars, and how come this vital information on Just my thoughts on the matter, cheers :) |
I agree that it should probably be mentioned in first run file. The reason why it is complicated to ship grammars is that we can't access the internet during build time. So to download sources of grammars we would need to parse the languages.toml and make flatpak-builder source definition to download them. Which I tried to do, but one of the grammars repo has a broken submodule and because of that flatpak-builder can't clone it (I made an issue ikatyang/tree-sitter-yaml#42). Also, if that will get resolved (or we just descide to ignore tree-sitter-yaml), are we suppose to ship the grammars? All the compiled grammars weight 120 MB, not everyone might need them. Although I guess when |
@blt-r Thanks for the quick reply. I think shipping the grammars without tree-sitter-yaml is the way to go, if they ever sort out your issue you can add it back again. 120 MB is nothing for a flatpak, and all the others distros ship them as far as I can tell. |
I made a PR (ikatyang/tree-sitter-yaml#48) to tree-sitter-yaml which updates the submodule. If they don't merge it I guess I will just hardcode it to use my fork. But then I also stumbled on this issue helix-editor/helix#7260 |
I had a quick go at refactoring your Running Helix Flatpak VersionIf you are running the Flatpak version of Helix, you may encounter some limitations due to the fact that it runs inside a container and cannot access tools on your host system. However, there are some workarounds that you can use to execute commands on the host system and get support for additional languages. Opening IssuesIf you encounter any issues related to the Flatpak version of Helix, you can open them at https://github.com/flathub/@FLATPAK_ID@/issues. Executing Commands on the Host SystemTo execute commands on the host system, you can use the following command: $ flatpak-spawn --host <COMMAND> This will allow you to execute commands on the host system from within the Flatpak container. Adding Language Server EntriesIf you want to use a language server installed on your host system, you will need to add an entry to your [[language]]
name = "rust"
language-server = { command = "flatpak-spawn", args = ["--host", "rust-analyzer"] } This will allow you to use the Rust language server installed on your host system from within the Flatpak container. Installing Flatpak SDK ExtensionsBy default, the Flatpak version of Helix provides access to standard development environments such as GCC and Python. However, if you need support for additional languages (including language servers), you will need to install SDK extensions. To install SDK extensions, use the following commands: $ flatpak install flathub org.freedesktop.Sdk.Extension.rust-stable
$ flatpak install flathub org.freedesktop.Sdk.Extension.llvm15 This will install the Rust and LLVM SDK extensions. Enabling SDK ExtensionsAfter installing SDK extensions, you will need to enable them. To do this, set the $ FLATPAK_ENABLE_SDK_EXT=rust-stable,llvm15 flatpak run @FLATPAK_ID@ This will add compilers, language servers, and other tools to your $PATH. Checking Language Server DetectionTo check which language servers have been detected, run Helix with the --health option: $ FLATPAK_ENABLE_SDK_EXT=rust-stable,llvm15 flatpak run @FLATPAK_ID@ --health You can also get information about a specific language: $ FLATPAK_ENABLE_SDK_EXT=rust-stable,llvm15 flatpak run @FLATPAK_ID@ --health rust Making Changes PersistentTo make changes to the environment variables persistent, use the flatpak override command: $ flatpak override --user @FLATPAK_ID@ --env=FLATPAK_ENABLE_SDK_EXT="rust-stable,llvm15" Finding Other SDK ExtensionsTo find other SDK extensions, use the following command: $ flatpak search <TEXT> Markdown to copy/paste
|
Thanks, this will be useful. We could just use a markdown file as a first run file. Considering that there will be syntax highlighting in it, I think it would be more readable than just plain text. |
Seems grammar .so files are missing:
Can't find the grammars folder:
/var/lib/flatpak/app/com.helix_editor.Helix/current/active/files/share/helix/runtime
This is on Debian 11 Stable.
The text was updated successfully, but these errors were encountered: