Closed DamianFekete closed 2 months ago
Thanks for the issue. You have to select the text for this to work (otherwise we don't know what to select to extract).
https://github.com/user-attachments/assets/bbb1f1dd-3d35-4a50-84e6-03784ed38f0a
We could potentially special case strings to auto pick the whole thing, but there's a perf penalty with generating code actions everywhere.
Reopening. Going to mark as an enhancement request for upvotes.
Type: Bug
Behaviour
No refactorings available / No code actions for 'refactor.extract.variable' available
Steps to reproduce:
Open the folder in VS Code
Right click somewhere in the text
Ohh no
. ChooseRefactor...
from the popup menu. The message is: No refactorings available. I think it should allow you to at least extract the text as a variable.If I use the keyboard shortcut to extract text to variable I get this error:
I have tried using not only the release version of the Python/Pylance plugins, but the pre-release versions as well. The default Language Server for Python was default, I have set it explicitly to Pylance now, without success:
I don't see any other errors and don't know how to debug this issue further.
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` XXX ```
Extension version: 2024.12.3 VS Code version: Code 1.92.2 (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z) OS version: Windows_NT x64 10.0.19045 Modes:
python.languageServer
setting: PylanceUser Settings
``` languageServer: "Pylance" ```
Installed Extensions
|Extension Name|Extension Id|Version| |---|---|---| |Edit csv|janisdd.vscode-edit-csv|0.9.2| |EditorConfig for VS Code|EditorConfig.EditorConfig|0.16.4| |IntelliJ IDEA Keybindings|k--kato.intellij-idea-keybindings|1.7.2| |JavaScript Debugger|ms-vscode.js-debug|1.92.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.3| |PowerShell|ms-vscode.powershell|2024.2.2| |Pylance|ms-python.vscode-pylance|2024.8.2| |Python|ms-python.python|2024.12.3| |Python Debugger|ms-python.debugpy|2024.11.2024082901| |SailPoint Identity Security Cloud|yannick-beot-sp.vscode-sailpoint-identitynow|1.3.2| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9|System Info
|Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2304)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|31.73GB (12.73GB free)| |Process Argv|.| |Screen Reader|no| |VM|0%|
The original bug report against VS Code was closed: https://github.com/microsoft/vscode/issues/225766