question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing code actions for refactoring key binds

See original GitHub issue

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"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
DanTupcommented, Aug 20, 2019

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.

0reactions
DanTupcommented, Aug 19, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refactoring source code in Visual Studio Code
This keybinding, for example, triggers the Extract function refactoring Code Actions: { "key": "ctrl+shift+r ctrl+e", "command": "editor.action.
Read more >
Assign a Keyboard Shortcut to a Refactoring | CodeRush
Type code action names, separated by semicolons, in the “Parameters” text box. If only one of the specified code actions is available in...
Read more >
Refactor menu missing from Visual Studio 2015 - Stack Overflow
The given link goes to a page for Visual Studio 2008. A list for V.S. 2015 is at msdn.microsoft.com/en-us/library/da5kh0wa.aspx#bkmk_refactor.
Read more >
Code refactoring | IntelliJ IDEA Documentation - JetBrains
Press Ctrl+Alt+Shift+T to open a list of refactorings that can be selected. refactor this popup. Alternatively, you can use a keyboard shortcut ...
Read more >
Refactoring code - Visual Studio for Mac | Microsoft Learn
Quick Actions and Refactorings let you easily refactor, generate, or otherwise modify code with a single action. Quick Actions can be used to:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found