Code Actions Keyboard Shortcut splitting on Cursor Position

Problem description:
Code actions triggered with the CMD+. keyboard shortcuts is splitting on the cursor position.

For example, consider the following code (assume atom isn’t imported):

export const searchValue = atom("");

If I put my cursor between a and tom and use the CMD+. keyboard shortcut for code actions, I see something like this screenshot:

Screenshot 2023-08-29 at 11.25.38 AM

Notice how only “a” is highlighted green.

This continues with almost every other cursor position in the atom keyword.

Screenshot 2023-08-29 at 11.26.22 AM
Screenshot 2023-08-29 at 11.26.32 AM

When I move my cursor to the end, I finally see the result I’m looking for (atom is located in the jotai package)
Screenshot 2023-08-29 at 11.26.48 AM

Expected behavior:
Regardless of where my cursor is located in an un-imported keyword, Code Actions/suggestions should include the entire keyword.

Actual behavior:
Code Suggestions splits and only suggests an action with the left-hand-side of the keyword my cursor is on

Steps to reproduce:
See initial problem description and attached video

Bug appears at this link:
Any Repl with typescript-language-server as its LSP (I’ve only tried in Typescript / React (Next.js + TailwindCSS template))

Repl Reproduced in: https://replit.com/@IroncladDev/VultangDev

Video Demonstration

Browser: Chrome
OS: MacOS
Device (Android, iOS, n/a leave blank): Macbook Pro 14" Ventura
Plan (Free, Hacker, Pro Plan): Pro Plan

3 Likes

We’re on it, thanks for the report.

4 Likes

Hey Conner - heads up, the team just did some work that should fix this up. I’m going to mark this as solved.

Thanks again for reporting and good to see you!

1 Like

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