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

Option to ignore #bibliography and add words to the dictionary #40

Open
michihupf opened this issue Jan 15, 2025 · 3 comments
Open

Option to ignore #bibliography and add words to the dictionary #40

michihupf opened this issue Jan 15, 2025 · 3 comments

Comments

@michihupf
Copy link

michihupf commented Jan 15, 2025

Writing in german but having a lot of english references i get a LOT of useless spelling mistakes on my bibliography. It would be nice if this could be deactivated.

Also a nice feature would be be able to add domain specific words to the dictionary. I always find myself looking at warnings that are obviously correct (false positives on domain specific knowledge).

Also please let me know if this is something that is already possible, I have not found any documentation regarding this (Edit: I found the example for vscode but that doesn't really translate into the helix config)

@antonWetzel
Copy link
Owner

antonWetzel commented Jan 18, 2025

Maybe you can change the language for your bibliography

#{
    // not tested
    set text(lang: "en", region: "US")
    bibliography("references.bib")
}

You should be able to configurate a personal dictionary in your ./.helix/languages.toml file or use the options argument, to load the configuration from a json file.

[language-server.typst-languagetool]
command = "typst-languagetool-lsp"

[language-server.typst-languagetool.config]
# options = "./typst-languagetool.json" # load from JSON file
backend = "server"
host = "http://127.0.0.1"
port = "8081"

[language-server.typst-languagetool.config.dictionary]
en-US = ["a", "b", "c"]

[[language]]
name = "typst"
language-servers = ["typst-languagetool"]

I hope this works, but I did not test it in helix.
If the issue persists or another related problem arises, please reopen the issue.

Edit

Add options argument in toml example.

@michihupf
Copy link
Author

I could not configure a custom dictionary from the local .helix/languages.toml. I think this is due to typst-languagetool only supporting init configs but I may be wrong -- haven't looked much into the code for helix and this project. Putting custom dictionaries in my global ~/.config/helix/languages.toml works. I will try the options argument, thank you :D

Unfortunately just changing the bib language also won't work as I have a lot of german references also....

@michihupf
Copy link
Author

I would like to reopen this issue as I could not manage to get the options argument to work. I can only change global configuration, not local per project.
Neither did changing the language before the bibliography produce any usable results -- but I guess multi language is not supported by languagetool so this is just something I have to live with.

Is there a workaround for this or can I only use the global config ~/.config/helix/languages.toml with typst-languagetool?

Changes in .helix/languages.toml in the project directiory do not change anything. I have already configured custom settings for tinymist in there so it is not an issue with helix.

I would appreciate a little help or direction, thanks :D

Unfortunately I do not have permission to reopen which is why I think I have to mention -- sorry for that. @antonWetzel

@antonWetzel antonWetzel reopened this Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants