-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Problem
When hovering over a possessive form like account's, the definition for Account is shown twice in the hover popup.
Reproduction
- Use the default glossary in
simple_workspace(which contains a termAccount) - Open a file containing the text
account's - Hover over
account's— the definition forAccountappears twice
Why this happens
The apostrophe ' is not in Lexer.delimiters (Tokeniser.fs), so account's is treated as a single token. TokenSplitterRegex (CandidateTerms.fs) then splits it into ["account", "s"], and normalise generates window chunks: "account" (size 1) and "accounts" (size 2). Since "accounts" is singularized to "account" by Humanizer, the same term matches twice.
Possible fixes
- Add
'toLexer.delimiters— the tokeniser would splitaccount'sintoaccountandsbefore candidate term generation. This is arguably the correct behaviour since possessive'sis not part of the word itself. - Add
Seq.distinctByinfindMatchingTermsInIndex(Hover.fs) — deduplicate matches by term name. This is a narrower fix that doesn't change tokenisation.
I'm happy to submit a PR for either approach. What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels