helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
32.54k stars 2.4k forks source link

Improve the user experience with disabled sourcehut grammars #11258

Open mxmerz opened 1 month ago

mxmerz commented 1 month ago

Helix has tree-sitter grammars for languages hare, wren, and gemini, but they are disabled by default in languages.toml, because of unreliability issues with their repositories (see #9316):

use-grammars = { except = [ "hare", "wren", "gemini" ] }

I was not getting syntax highlighting for hare files and it took me quite a while to discover that this was the reason.

I would propose the following changes to make this fact easier to discover:

I could try to prepare pull requests if you would support these changes?

the-mikedavis commented 1 month ago

Oh hmm I guess the merging behavior for config doesn't work well with use-grammars. I wonder if we can explicitly prefer that key from whichever config is loaded last if it is present instead so it works as expected/documented. Documenting that we have exceptions to the grammars we include by default sounds good to me. I'm not sure about including a warning in --health since completions use hx --health languages to determine which list of languages to show and adding rows to the output will mess up its output. Adding it to --grammar sounds good though.

In the long run we'd eventually like to not include many more grammars by default and instead make it possible to install them interactively. That feature needs a lot of design though