Bug 468130

Summary: Kate adds double dots before method name when using autocomplete (TypeScript)
Product: [Applications] kate Reporter: Karmo Rosental <karmo.rosental>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: waqar.17a
Priority: NOR    
Version First Reported In: 23.04.3   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Karmo Rosental 2023-04-03 20:38:52 UTC
SUMMARY
Kate adds double dots before method name when using autocomplete (TypeScript Language Server). Started to happen when I did bigger update to KDE components today (Plasma 5.27 etc).

rust-analyzer for Rust language doesn't add double dots before methods.

STEPS TO REPRODUCE
1. Install TypeScript Language Server
2. Open or create a .ts file
3. Try to write inside:

const n = 1;
n.toString

and press enter to autocomplete.

OBSERVED RESULT
Code looks like n..toString()

EXPECTED RESULT
Code looks like n.toString()
Comment 2 Waqar Ahmed 2023-04-03 20:42:37 UTC
Fixed in 23.04

But to work around the issue, you can downgrade typescript language server
Comment 3 Karmo Rosental 2023-07-15 08:41:19 UTC
Same issue is back with recent updates.
Comment 4 Bug Janitor Service 2023-07-18 07:55:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1261
Comment 5 Waqar Ahmed 2023-07-18 16:35:06 UTC
Git commit bb94925014f710ea89752949d5ab90aefafd2175 by Waqar Ahmed.
Committed on 18/07/2023 at 07:55.
Pushed by waqar into branch 'master'.

lsp: always honor server when using Completion.textEdit.newText

If server is specifying a different range start than what we have,
perfer the server always.

Only do this if Completion.textEdit.newText is the text we are going to
insert. With pure insertText things are generally simpler.

This fixes issues with dart-analyzer and typescript-language-server

M  +5    -2    addons/lspclient/lspclientcompletion.cpp

https://invent.kde.org/utilities/kate/-/commit/bb94925014f710ea89752949d5ab90aefafd2175
Comment 6 Waqar Ahmed 2023-07-21 17:23:10 UTC
Git commit 49f999df43e8652817e5937e12bdc818f94f5b6c by Waqar Ahmed.
Committed on 21/07/2023 at 17:22.
Pushed by waqar into branch 'release/23.08'.

lsp: always honor server when using Completion.textEdit.newText

If server is specifying a different range start than what we have,
perfer the server always.

Only do this if Completion.textEdit.newText is the text we are going to
insert. With pure insertText things are generally simpler.

This fixes issues with dart-analyzer and typescript-language-server
(cherry picked from commit bb94925014f710ea89752949d5ab90aefafd2175)

M  +5    -2    addons/lspclient/lspclientcompletion.cpp

https://invent.kde.org/utilities/kate/-/commit/49f999df43e8652817e5937e12bdc818f94f5b6c