Selecting an option from LSP Code Actions (CMD+.) removes focus from the editor

Problem description:
When I put my cursor over a keyword that is not imported, use the CMD+. keybind to trigger code actions, and accept it, the dependency gets imported but my cursor loses focus from the code file I’m in.

Expected behavior:
My cursor should jump to either the end of the imported keyword, or remain at its original position.

Actual behavior:
My cursor has lost focus of the current file.

Steps to reproduce:

  1. Create a typescript/tsx file and create a valid export
  2. Go to another file and do something simple like console.log(Dependency). Don’t import it yet.
  3. Put your cursor within bound of the unimported keyword
  4. Use the CMD+. keyboard shortcut (CTRL+. on windows/linux I think)
  5. Select the option to import it with the Enter key
  6. Cursor is no longer focusing the current file

Screen Recording

Bug appears at this link:
Confirmed to work in any Repl with a Typescript LSP.

Repl Link (private): https://replit.com/@IroncladDev/VultangDev
Repl ID: 614cf7f9-2ede-4fb9-9adf-3ea8e70dbc36

Browser: Chrome
OS: MacOS
Device (Android, iOS, NA leave blank): Macbook Pro 14" Ventura
Desktop app version (Avatar menu->“Version”) or NA: N/A (was coding in browser this time)
Plan (Free, Hacker, Pro Plan): Pro Plan

Hey @IroncladDev!

Thank you for the detailed report, as always! I was able to reproduce this and have sent it to the engineering team. I will post any updates in this topic.

Thank you for the update!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

We have recently released a fix for this issue. If you are still able to repro, let me know and I’ll follow up with the eng team!

1 Like