You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Activating a key-binding to extract a method (using C#) does not extract the method. Though the code action does work if you do it through the right click menu.
Attempt to use hotkey to extract code into a method.
publicclassProgram{publicstaticvoidMain(){// Highlighting from herefor(inti=0;i<10;i++){Console.WriteLine("Test"+i);}// to here}}
The hotkey fails with tooltip: "No code actions for 'refactor.extract.function' available"
Expected Behavior
The action to extract a method via a hotkey (step 3) does not work (unexpected).
If you use the UI menu instead of a keyboard shortcut to extract into a method ("Right Click -> Refactor -> Extract Method") the functionality does succeed.
Environment Information
Edition Windows 11 Enterprise
Version 23H2
Installed on 7/13/2023
OS build 22631.3880
Experience Windows Feature Experience Pack 1000.22700.1020.0
I ran into the same thing while trying to set up a specific refactor action on a keyboard shortcut. Nothing works other than the base refactor kind, and the extension output shows Code actions of kind 'refactor.extract.function' requested but returned code action is of kind 'quickfix'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
Originally filed by @rilehudd at microsoft/vscode-dotnettools#1335
Describe the Issue
Activating a key-binding to extract a method (using C#) does not extract the method. Though the code action does work if you do it through the right click menu.
Steps To Reproduce
Reproduction steps:
The hotkey fails with tooltip: "No code actions for 'refactor.extract.function' available"
Expected Behavior
The action to extract a method via a hotkey (step 3) does not work (unexpected).
If you use the UI menu instead of a keyboard shortcut to extract into a method ("Right Click -> Refactor -> Extract Method") the functionality does succeed.
Environment Information
Edition Windows 11 Enterprise
Version 23H2
Installed on 7/13/2023
OS build 22631.3880
Experience Windows Feature Experience Pack 1000.22700.1020.0
Version: 1.93.0-insider
Commit: 3b27f1f74bc09fe2e2068997fcd42768be44a4e3
Date: 2024-08-02T05:03:53.254Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631
The text was updated successfully, but these errors were encountered: