Automattic / Automattic/harper

Regex preprocess before grammar/spell parsing.

Open
#3,450 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
102

Description

**What problem does this solve?**
Pretty much, I love to write anything in VSCode, this includes stuff for Minecraft, which popularly uses their formatting codes (e.g. `&4` for `dark_red`). The problem is, Harper flags just about any instance that uses these when they hug up against a word or a quote. The exclude setting doesn't solve this entirely.

**Proposed Solution**
The regex preprocess would "filter out" matches (such as the `&f` from `&f"You`) and then let the grammar/spell parsing check on `"You` instead.
```
"harper.preprocessPatterns": [
{
"match": "&.",
"replace": ""
}
]
```

**Examples**
Unsure how to show an example for the above, aside from what was mentioned in the proposed solution.

**Component**
- [ ] Core engine
- [x] Plugin/Extension
- [ ] Other: Settings

**Additional Context**
Any other relevant info.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the VSCode extension handles settings and how text reaches grammar and spell parsing. Focus on the proposed harper.preprocessPatterns configuration and verify that configured matches are filtered before parsing, while surrounding text such as "You is still checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.