Bug 401509

Summary: Autocompletion doesn't complete incomplete uppercase-snake-style words
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Laura David Hurka <laura.stern>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: laura.stern, waqar.17a
Priority: NOR    
Version First Reported In: 5.90.0   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Laura David Hurka 2018-11-28 17:00:02 UTC
SUMMARY
C defines written in uppercase snake style are not recognized/accesible by kate's autocompletion (Ctrl+Space), like words in lowercase snake style are.

STEPS TO REPRODUCE
1. Write '#ifndef SNAKE_STYLE_H'
2. Write '#define SSH' or '#define ssh'
3. Trigger autocompletion (Ctrl+Space, if you disabled auto-autocompletion)

OBSERVED RESULT
Autocompletion does nothing. Uppercase words have to be written exactly, before they are recognized (SNA[...] instead of SSH)

EXPECTED RESULT
Autocompletion recognizes the first letters 'S', 'S', 'H', which follow \b or _, so SSH (or even ssh) can be completed. Because the word is all uppercase, 'NAKE' and 'TYLE' are no "first letters", like capital letters in camel-case are.

SOFTWARE/OS VERSIONS
Everything I used in the last 6 Years (Kubuntu, other *buntu, Raspian, Windows, kdelibs4, KF5, many kate versions...)
Comment 1 Waqar Ahmed 2021-10-11 07:24:22 UTC
most likely an issue in the fuzzy matcher in KTextEditor's completion. Fix would be trivial I think.
Comment 2 Bug Janitor Service 2022-01-17 18:22:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/257
Comment 3 Christoph Cullmann 2022-01-18 18:43:17 UTC
Git commit 775bcde281ffe32d41803e01b89ff16faad54876 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 18/01/2022 at 18:34.
Pushed by cullmann into branch 'master'.

Do proper fuzzy matching in completion

Use KFuzzyMatcher for fuzzy matching. Results are better and fixes the
linked bug.

Also remove some dead code related to case sensitivity while at it.

M  +10   -103  src/completion/katecompletionmodel.cpp
M  +1    -4    src/completion/katecompletionmodel.h

https://invent.kde.org/frameworks/ktexteditor/commit/775bcde281ffe32d41803e01b89ff16faad54876