"No refactorings available" / "No code actions" when cursor is inside of a string #6344
DamianFekete
started this conversation in
Enhancement
Replies: 2 comments 1 reply
-
Thanks for the issue. You have to select the text for this to work (otherwise we don't know what to select to extract). Screen.Recording.2024-09-03.094851.mp4We could potentially special case strings to auto pick the whole thing, but there's a perf penalty with generating code actions everywhere. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Reopening. Going to mark as an enhancement request for upvotes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
)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
Installed Extensions
System Info
canvas_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
The original bug report against VS Code was closed: microsoft/vscode#225766
Beta Was this translation helpful? Give feedback.
All reactions