-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Issue Description
Hey! First of all, thanks for this extension, it's been really helpful for catching typos in my code. I'm using it in Zed with PHP and I think I found a bug.
It seems like the spell checker inconsistently flags errors depending on what comes after (or around) the misspelled word. Here are two scenarios where I reproduced it:
Scenario 1 - Misspelled word inside a string
When the string path ends with an incomplete/invalid word, the error is flagged correctly:
return view('administraton/dashb', $data);administraton (missing the "i") is correctly underlined. ✔️
But when the path ends with a valid dictionary word, the error disappears:
return view('administraton/dashboard', $data);administraton is no longer flagged, even though it's still misspelled.
Expected result:
Scenario 2 - Misspelled segment in a camelCase function name
When the function name ends with an incomplete/invalid word, the error is flagged:
public function getConseGroupSal() // I left out the 'e' in Sal()Conse is correctly underlined. ✔️
But when the function ends with a valid word, the error disappears:
public function getConseGroupSale()Conse is no longer flagged.
Expected result:
Expected behavior
A misspelled word/token should be flagged regardless of what comes before or after it. The validity of adjacent tokens shouldn't affect the detection of an already-invalid one.
Environment
- Editor: Zed
- Language tested: PHP
- Extension: codebook
Operating System
Windows
Editor
Zed
Codebook Version
0.3.31
Configuration
dictionaries = ["en_us"]
ignore_paths = ["target/**/*", "**/*.json", ".git/**/*"]
ignore_patterns = [
'\b[ATCG]+\b', # DNA sequences
'\d{3}-\d{2}-\d{4}', # Social Security Number format
'^[A-Z]{2,}$', # All caps words like "HTML", "CSS"
'https?://[^\s]+' # URLs
]Steps to Reproduce
Open a PHP file
Expected Behavior
Actual Behavior
Scenario 1
Scenario 2
Code Sample
Scenario 1
return view('administraton/dashb', $data);
return view('administraton/dashboard', $data);
Scenario 2
public function getConseGroupSal() {}
public function getConseGroupSale() {}
Log Output
Additional Context
No response