Skip to content

"Extract to ARB" not showing up for Cursor #126

Description

@zzSleepyCoderzz

ISSUE

The "Extract to ARB" is supposed to show up when you highlight a string (yes, with the quotes) and then show the Code Actions menu by clicking CMD + . on Mac or CTRL + . on Windows.

Works for Windows, but does not work for Cursor.

Flutter Intl Extension Version on VS Code: 1.19.3
Flutter Intl Extension Version on Cursor: 1.18.2

STEPS TO REPRODUCE

Simply set up Flutter, install the extension on both IDEs and open a project.

SOLUTIONS TRIED

  1. Tried the steps in issue Extract to ARB Function Not Working Properly with Flutter 3.24.0 in VS Code Extension #118
  2. Used Claude Code to make some tweaks and managed to get it working. But I do not understand the fix therefore cannot recommend it to others. Below is the explanation from Claude.
Cursor explicitly sets n.only = CodeActionKind.Refactor when you open the Refactor submenu — it's telling extensions "I only want refactor-type actions, filter everything else out."

VS Code leaves n.only as undefined for the same menu — it says "give me everything, I'll handle the filtering."

So the bug only triggers in Cursor because Cursor is stricter about passing the filter down to extensions. The extension's check was written assuming n.only would always be undefined or an exact match — it never anticipated a parent kind being passed.

// Current (buggy):
if (n && n.only && !r.CodeActionKind.RefactorExtract.contains(n.only)) return false;

// Should be:
if (n && n.only && !n.only.contains(r.CodeActionKind.RefactorExtract)) return false;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions