Bug 474989 - Autocompleting with LSP-plugin "import" (typescript) expressions inserts second import with { and }
Summary: Autocompleting with LSP-plugin "import" (typescript) expressions inserts seco...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-28 14:31 UTC by Henri K
Modified: 2023-11-30 07:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henri K 2023-09-28 14:31:08 UTC
STEPS TO REPRODUCE
1. Enable LSP-plugin.
2. install a language server, in my case: npm -g install typescript-language-server
3. make sure server is enabled.
4. open a file supported by the language server. in my case a .ts -file.
5. write "import { " and begin to type something until you see completion suggestions.
6. Select one and hit enter

OBSERVED RESULT

for example if I type:

"import { take"

and select from completion popup-menu "takeUntil [rxjs]" and hit enter I get:

import { import { takeUntil } from 'rxjs';}

It adds second "import" with extra { and }.

EXPECTED RESULT

import { takeUntil } from 'rxjs';

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Comment 1 Waqar Ahmed 2023-09-28 16:31:25 UTC
Can you try with latest Kate (23.08.3) ?
Comment 2 Henri K 2023-09-30 08:36:04 UTC
(In reply to Waqar Ahmed from comment #1)
> Can you try with latest Kate (23.08.3) ?

Seems that it's fixed in that version. There's still extra '}' at the end of line but noticed it's from setting "Automatically close brackets when opening bracket is typed". So when "{" is typed it already adds that "}" at right side of cursor which stays there after completion. Seems unexpected for me. Can be avoided by skipping typing that first "{"  though.
Comment 3 Waqar Ahmed 2023-11-30 07:44:03 UTC
> So when "{" is typed it already adds that "}" at right side of cursor

These kinds of annoyances are still there, I will see if I can find a generic way to work around this issue. Thanks for testing and reporting the bug.