feat(core): matcher_spelling.rs and docs for matcher.rs (fix #558) #559
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.
Please see issue #558 for full context (Harper has spell check rules in both
./harper-core/src/linting/spell_check.rs
andmatcher.rs
but the latter is undocumented and lacks a fine-grained configuration option to disable it, yet users may wish to disable it due to conflicts with their editors’ local/user spelling checker). This PR:matcher.rs
(“Did you mean”).matcher.rs
into spelling and non-spelling rules, using distinct messages that match the documentation.matcher_spelling
so that the spelling rules inmatcher.rs
can be disabled while keeping its grammar rules enabled.This is a small tactical workaround, not a perfect solution, as the hard-coded
matcher.rs
is to be removed in a future release. A minor residual inconvenience is that users who have configuredmatcher=false
andspell_check=false
(the existing options) will see matcher spelling messages until they setmatcher_spelling=false
too (the new option). However, given the absence of existing GitHub issues and PRs, few users may be currently impacted.