Support cspell like custom local dictionaries #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.tomllike so:Also this feature lets the user add local dictionaries in a round about way.
TO-DO:
codebook/src/lib.rsto a helper.rethinktry_normalizing_relative_paths, could cause bad times if we ever write a relative path back as absolute.WatchedFilewhen updating custom dictionaries.I feel like the main issue is state management, I want to change
DictionaryManagerto hold concrete implementations ofDictionaryor maybe add a new add a neweditable_dictionariesfield that would hold all the editable dictionaries and there respectiveWatchedFile. I would love to hear what you have to say.