Skip to content

Tries to correct user-added capitalisations to dictionary capitalisation #2156

@IFcoltransG

Description

@IFcoltransG

Describe the bug
Adding a specific capitalisation of a word to the user dictionary does not prevent Orthographic Consistency errors: The canonical dictionary spelling is ...

To Reproduce
With VS Code extension (0.71.0), write a sentence containing the word "al" in lowercase, such as The poet was called al-Ghazal.. In Quick Fixes/More Actions over the word "al", add it to the user dictionary. Confirm that lowercase "al" has been added to the user dictionary.

The sentence will still have an underline for "al", giving the message This word's canonical spelling is all-caps.Harper (OrthographicConsistency) on hover. It will offer a Quick Fix to replace with "AL".

This occurs for many, but not all, types of capitalisation change:

  • Adding lowercase for existing uppercase ("AL" → "al")
  • Adding mixed case for existing title case ("Edna" → "eDNA")
  • Adding all-caps for existing mixed case ("pH" → "PH")
  • Adding mixed case for existing lowercase ("ml" → "mL")

However, all-caps versions of lowercase words seem to be accepted without needing to be added to the dictionary ("phlogiston" → "PHLOGISTON") and all-caps versions of mixed case words are accepted if they are added to the user's dictionary ("McMillan" → "MCMILLAN"). Mixed case to a different mixed case seems to sometimes allow a user version ("iPhones" → "iPhoneS") but sometimes not ("iPad" → "Ipad").

Expected behaviour
If a certain capitalisation of a word is in the user's dictionary, Harper should not recommend changing that capitalisation to the version in Harper's dictionary.

Additional context
Adding a second mixed case capitalisation of the same word deletes any existing mixed case capitalisations of that word that are already in the user dictionary, preventing you from putting two possible mixed case variations in the user dictionary.

This is probably related to #1688 and #2151.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglintingspellingRelated to Harper's spellchecker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions