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

Invalid key code 'diagnostics' when trying to set end-of-line-diagnostics according to #11591

Open
jerabaul29 opened this issue Aug 27, 2024 · 5 comments
Labels
A-documentation Area: Documentation improvements

Comments

@jerabaul29
Copy link
Contributor

I am setting my config similar to:

helix/book/src/editor.md

Lines 432 to 434 in af7a1fd

end-of-line-diagnostics = "hint"
[editor.inline-diagnostics]
cursor-line = "warning" # show warnings and errors on the cursorline inline

by appending this snippet at the end of my config. However, I then get the following error:

Bad config: TOML parse error at line 40, column 1
   |
40 | end-of-line-diagnostics = "hint"
   | ^^^^^^^^^^^^^^^^^^^^^^^
Invalid key code 'diagnostics'

Press <ENTER> to continue with default config

commenting out the first line, i.e. appending

# end-of-line-diagnostics = "hint"
[editor.inline-diagnostics]
cursor-line = "warning"

works fine; should the end-of-line-diagnostics be set in another way somehow? :)

@jerabaul29
Copy link
Contributor Author

kzm@kzm-bpq:~$ hx --version
helix 24.7 (af7a1fd2)
kzm@kzm-bpq:~$ hx --health
Config file: /home/kzm/.config/helix/config.toml
Language file: default
Log file: /home/kzm/.cache/helix/helix.log
Runtime directories: /home/kzm/.config/helix/runtime;/home/kzm/Desktop/Software/helix/runtime;/home/kzm/.cargo/bin/runtime
Runtime directory is empty: /home/kzm/.cargo/bin/runtime
Clipboard provider: wl-paste+wl-copy
System clipboard provider: wl-paste+wl-copy
...

@jerabaul29
Copy link
Contributor Author

jerabaul29 commented Aug 27, 2024

Ok, the trick is that end-of-line-diagnostics = "hint" should be part of the [editor] section; I wonder if this could be documented better in the snippet provided? (it is documented in the [editor] section, but this is quite a bit away from the example snippet).

@jerabaul29
Copy link
Contributor Author

I.e. what about updating the documentation snippet to be:

end-of-line-diagnostics = "hint"   # NOTE: this must be part of the [editor] section, put it at the good location in the config!
[editor.inline-diagnostics] 
cursor-line = "warning" # show warnings and errors on the cursorline inline 

@jerabaul29
Copy link
Contributor Author

(if you think this is an ok note to add I can open a PR to push this :) ).

@the-mikedavis
Copy link
Member

Since we don't have any other config in that block I think it would make sense to add the [editor] above that line, i.e.:

[editor]
end-of-line-diagnostics = "hint"
[editor.inline-diagnostics]
cursor-line = "warning" # show warnings and errors on the cursorline inline

We can also switch that codefence to use ```toml to get TOML syntax highlighting like the rest of the config snippets. Feel free to open up a PR

@the-mikedavis the-mikedavis added the A-documentation Area: Documentation improvements label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Documentation improvements
Projects
None yet
Development

No branches or pull requests

2 participants