Skip to content

Take into account wordCompletionRemoveTail in completionRange() default implementation

Ahmad Samir requested to merge work/ahmad/tail into master

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.

BUG: 436170

Edited by Christoph Cullmann

Merge request reports

Loading