It looks like when code auto-completion is done by the LSP plugin, it removes the tail by default and there is no setting to change that. Maybe it should follow the global setting in the auto-completion config dialog or have a separate option?
Can you elaborate on the "Removes the tail by default"? I don't understand what you mean by that.
When you are in the middle of a word and autocomplete a word from the document and have "Remove tail on complete" disabled, it will autocomplete the rest of the completion word, but not remove the end of the "original" word. autocomplete the word "startComplete" with the cursor at "|" on the following line start|End would give: startComplete|End in stead of: startComplete| (without "End") Further if the "Remove...." is enabled, the first undo will only undo the removal of the "End", so the completion is done as two separate edit actions... I have been missing this, but not enough to scratch my itch...
An example: if (fileName.endsWith("foo")) { .... } Now if I put the cursor right before "fileName" and type "QStringV", and auto-complete it to QStringView the text becomes: if (QStringView.endsWith("foo")) { whereas with "remove tail on complete" (in settings -> Editing -> Auto-Completion) disabled I expect (and that's how it works without the LSP completion, i.e. if I disable the LSP plugin): if (QStringViewfileName.endsWith("foo")) { (then I just type the opening '(' and go on ...etc.) Does that make sense?
Mid-air comments collision :)
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/391
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/148
Git commit e337a224309860e0bb50a61a0c012a474457bb29 by Christoph Cullmann, on behalf of Ahmad Samir. Committed on 06/06/2021 at 07:10. Pushed by cullmann into branch 'master'. WIP: Take into account wordCompletionRemoveTail in completionRange() default implementation If the wordCompletionRemoveTail option is enabled CodeCompletionModelControllerInterface::completionRange() will return a range containing the whole word the cursor is inside, which means that the whole word will be replaced by the selected completion; however if that option is disabled then it'll return a range containing only the part of the word on the left of the cursor. This simplifies the code: - KateWordCompletionModel::completionRange() is now redundant (finding the word start/end is already done in CodeCompletionModelControllerInterface::completionRange()) - KateWordCompletionModel::executeCompletionItem() doesn't need to find the end of the word being completed, less code The Kate plugins that implement their own completion models, e.g. KateProjectCompletion, can now remove their implementation of completionRange() (which is a copy of KateWordCompletionModel::completionRange()); and the LSPClient plugin completion model now should automatically follow the wordCompletionRemoveTail config option. M +1 -46 src/completion/katewordcompletion.cpp M +0 -2 src/completion/katewordcompletion.h M +5 -1 src/include/ktexteditor/codecompletionmodelcontrollerinterface.h M +19 -9 src/utils/codecompletionmodelcontrollerinterface.cpp https://invent.kde.org/frameworks/ktexteditor/commit/e337a224309860e0bb50a61a0c012a474457bb29