Dart-code: Missing code actions for refactoring key binds

Created on 19 Aug 2019  路  5Comments  路  Source: Dart-Code/Dart-Code

The keybinding below worked well until recently. Now it displays a "No code actions available" message.

{
    "key": "cmd+. w",
    "command":  "editor.action.codeAction",
    "args": {
         "kind": "refactor.flutter.wrap.generic"
    },
    "when": "editorLangId == 'dart' && dart-code:anyFlutterProjectLoaded && editorHasCodeActionsProvider && editorTextFocus && !editorReadonly"
}
in editor is bug

Most helpful comment

This turned out to be my bug... There's filtering in code actions (to avoid requesting unrelated code actions) but it didn't correctly handle when the filter was a sub-kind of Refactor (eg. when VS Code asked for refactors it worked, but when asked for refactor.foo it did not.

All 5 comments

Do the code actions appear in the normal editor list (eg. with Cmd+.)? This sounds a bit like #1926 which I can't reproduce. Could you provide the info asked for here?

They appear and work in the normal list.

Flutter 1.9.0
VS Code 1.37.1
Dart Code 3.3.0
No errors in console

Ok, not the same. I can reproduce however. W're definitely returning matching code actions:

Screenshot 2019-08-19 at 4 22 51 pm

But they don't show up in the list... I'll do some digging.

This looks like a VS Code bug to me, so I've opened https://github.com/microsoft/vscode/issues/79455 with a repro hoping for some input.

This turned out to be my bug... There's filtering in code actions (to avoid requesting unrelated code actions) but it didn't correctly handle when the filter was a sub-kind of Refactor (eg. when VS Code asked for refactors it worked, but when asked for refactor.foo it did not.

Was this page helpful?
0 / 5 - 0 ratings