Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933727 - app-editors/helix No more syntax highlighting with helix editor for rust source code
Summary: app-editors/helix No more syntax highlighting with helix editor for rust sour...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-07 13:26 UTC by Stefan Salewski
Modified: 2024-06-12 13:18 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Salewski 2024-06-07 13:26:10 UTC
I installed helix in October 2023 for the first time, and all was working well, including rust-analyzer and syntax highlighting. But I can't remember the details of the install process -- I think it was very easy, no serious extra steps involved.

After a break of a few months, I tried to launch it again, and  syntax highlighting was missing. Observation:

```
$ ls /usr/share/helix/runtime/
queries  themes  tutor
```

There is no grammar directory, which was there earlier. hx --grammar fetch and hx --grammar build do generate it, then all is working fine again. I have no real idea about the issue, I tried to study https://wiki.gentoo.org/wiki/Helix, but the solution was not really obvious for me. Well now it works for me again, so feel free to close this report when you think it is not really an issue.

This is for

```
$ emerge -pv rust

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 1.22 s (backtrack: 0/20).

[ebuild   R    ] dev-lang/rust-1.77.1:stable/1.77::gentoo  USE="clippy lto nightly parallel-compiler profiler rust-analyzer rust-src rustfmt (-big-endian) -debug -dist -doc (-llvm-libunwind) (-miri) (-system-bootstrap) (-system-llvm) -test -verify-sig -wasm" CPU_FLAGS_X86="sse2" LLVM_TARGETS="AMDGPU (X86) -AArch64 -ARC -ARM -AVR -BPF -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -SPIRV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
salewski@hx90 ~ $ emerge -pv helix

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 1.19 s (backtrack: 0/20).

[ebuild   R   ~] app-editors/helix-24.03::gentoo  USE="-debug" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
```

I just saw that there is now a stable Helix 23.10-r2 available, maybe I should try that.

Reproducible: Always

Steps to Reproduce:
1.emerge -av helix
2.hx myrustcode.rs
3.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-07 13:36:37 UTC
Did you see https://gitweb.gentoo.org/repo/gentoo.git/tree/app-editors/helix/helix-24.03.ebuild#n335?

Maybe we should add that to the wiki...
Comment 2 Stefan Salewski 2024-06-07 13:44:53 UTC
Oh sorry, I missed that message. It is printed in ordinary text color only. I guess for first install I saw that message and followed the instructions. Then a reinstall must have removed the grammar folder.

It would be really nice if someone could copy these instructions to the wiki.

Thank you very much for the fast response -- I think we can close this issue.
Comment 3 Stefan Salewski 2024-06-07 14:11:13 UTC
It's me agian :-)

The instructions

```
	einfo "Grammars are not installed yet. To fetch and install them, run:"
	einfo ""
	einfo "  hx --grammar fetch"
	einfo "  hx --grammar build"
```

are actually not that clear. At least I was not sure if we should run them directly after "emerge helix" as root. When we do so, grammar folder is created in  /root/.config/helix/runtime/ which should not be intended. But running as user after creating the symlink ln -s /usr/share/helix/runtime ~/.config/helix/runtime as told in the wiki should not work.

So I guess the solution might be, as user

```
cp /usr/share/helix/runtime ~/.config/helix/runtime
hx --grammar fetch
hx --grammar build
```
Comment 4 Stefan Salewski 2024-06-07 14:27:57 UTC
Well, setting the environment variable

export HELIX_RUNTIME=/usr/share/helix/runtime

(in .bashrc) after

hx --grammar fetch
hx --grammar build

as user seems to be enough, no need to symlink or copy /usr/share/helix/runtime.