Open mxmerz opened 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
Helix has tree-sitter grammars for languages
hare
,wren
, andgemini
, but they are disabled by default inlanguages.toml
, because of unreliability issues with their repositories (see #9316):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:
Fix the corresponding documentation of the
use-grammars
config key, because that currently says "When omitted, all grammars are fetched and built". I would replace this with some note along the lines of "The default configuration disables the languageshare
,wren
, andgemini
because of a larger reliability and trust problem with the grammar repositories."In the pull request that made the change, the reasoning included the argument that “it is not hard to reenable them”. When I tried to do that in my user config, I noticed that apparently,
was not sufficient to re-enable all languages, as the exception list of the user config gets appended to the default config's list (it doesn't replace the default config's list). Instead, it is necessary (?) to configure either an
only
list with all languages, or configureand then run
hx --grammar fetch && hx --grammar build
to build these three languages, and then you can comment that line again to re-enable all other grammars.I would suggest some possibility of overwriting the
use-grammars
default config, without having to explicitly specify all languages. Or maybe this is already possible?It would also be great if
helix --health
andhelix --grammar
would report disabled grammars to the user in some way. I was really confused becausehelix --health
told me my language had highlight queries, even if nothing was highlighted.I could try to prepare pull requests if you would support these changes?