Skip to content
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

Incorrect merge of languages configuration leads to errors on startup #2188

Closed
poliorcetics opened this issue Apr 20, 2022 · 4 comments
Closed
Assignees
Labels
C-bug Category: This is a bug

Comments

@poliorcetics
Copy link
Contributor

poliorcetics commented Apr 20, 2022

Summary

$ hx languages.toml
Bad language config: missing field `scope` for key `language`
Press <ENTER> to continue with default language config

Probably came up after #2145 ? I'm trying to test it Reverting fixes the problem

Reproduction Steps

My languages.toml:

[[language]]
name = "rust"

[language.config]
assist.importGranularity = "module"

then do:

$ cd $HOME/.config/helix/
$ hx language.toml
Bad language config: missing field `scope` for key `language`
Press <ENTER> to continue with default language config

Commenting out the whole languages.toml and repeating the steps does not raise the error.

Helix log

No response

Platform

macOS

Terminal Emulator

kitty 0.25.0

Helix Version

1525e3c

@poliorcetics poliorcetics added the C-bug Category: This is a bug label Apr 20, 2022
@archseer
Copy link
Member

Reverted c8cfd0b for now

@poliorcetics
Copy link
Contributor Author

I can confirm this fixes the problem

@the-mikedavis
Copy link
Member

the-mikedavis commented Apr 21, 2022

Let's close this out in favor of the original toml merging issue (#1000) since the revert.

@LeoniePhiline
Copy link
Contributor

For the Googlers:

The error "Bad language config: missing field scope for key language" also occurs if you add an invalid/incomplete language to your languages.toml.

E.g. the following will trigger this message:

# Copy-pasted from "json" language, because prettier provides a "json5" parser - but the language config is incomplete.
# `scope` and other required fields are missing from the "json5" language configuration.
[[language]]
name = "json5"
formatter = { command = 'prettier', args = ["--parser", "json5"] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants