Skip to content

Conversation

@mayromr
Copy link

@mayromr mayromr commented Nov 4, 2025

This is my hack to implement this feature given the current dictionary management, explained in #85. I don't think it's polished yet (hence the draft pull request), I'll add a to-do list with issues that I think I need to solve before this can get merged.

The TLDR is that now you can add custom dictionaries definitions in the codebook.toml like so:

dictionaries  = ["relative"]

[[custom_dictionaries_definitions]]
name = "relative"
path = "./relative.txt"
allow_add_words = true

Also this feature lets the user add local dictionaries in a round about way.

TO-DO:

  • Update docs and readme.
  • move file access from codebook/src/lib.rs to a helper.
  • rethink try_normalizing_relative_paths, could cause bad times if we ever write a relative path back as absolute.
  • replace raw file access with WatchedFile when updating custom dictionaries.
  • Filter out custom dictionaries with non standard extension ( might not be the best idea ) .
  • Test on local machine.

I feel like the main issue is state management, I want to change DictionaryManager to hold concrete implementations of Dictionary or maybe add a new add a new editable_dictionaries field that would hold all the editable dictionaries and there respective WatchedFile. I would love to hear what you have to say.

@ccoVeille
Copy link

cc @Jason3S cspell maintainer

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

Successfully merging this pull request may close these issues.

2 participants