Skip to content

Extract variable/method ignores multi-selection #7611

@gaborfekete-greehill

Description

@gaborfekete-greehill

Type: Bug

Behaviour

I added the next find match to the selection the used the extract variable/method but only the first match gets extracted the other selections are ignored.

Steps to reproduce:

Simple example python script:

x = 1
if x == 1:
    pass
if x == 1:
    pass
  1. select the first x == 1 part of the line
  2. add next match to selection
  • now both same parts are highlighted
  1. refactor -> extract variable/method
  2. only the first match gets extracted

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

# nothing to show here

Extension version: 2025.14.0
VS Code version: Code 1.103.2 (6f17636121051a53c88d3e605c491d22af2ba755, 2025-08-20T16:45:34.255Z)
OS version: Linux x64 6.8.0-83-generic
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.10
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Pylance
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autodocstring njp 0.6.1
autopep8 ms- 2025.2.0
black-formatter ms- 2025.2.0
cpptools ms- 1.27.7
debugpy ms- 2025.10.0
docker doc 0.17.0
docker-explorer for 0.1.7
even-better-toml tam 0.21.2
flake8 ms- 2025.2.0
git-graph mhu 1.30.0
githistory don 0.6.20
gitlens eam 17.4.1
intellicode-api-usage-examples Vis 0.2.9
isort ms- 2025.0.0
jinja who 0.0.8
js-debug ms- 1.102.0
js-debug-companion ms- 1.1.3
jsoncrack-vscode Ayk 3.0.0
jupyter ms- 2025.7.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
mypy-type-checker ms- 2025.2.0
pre-commit-helper ela 0.5.0
project-manager ale 12.8.0
pylint ms- 2025.2.0
pyrefact oll 2024.0.1
python ms- 2025.14.0
python-environment-manager don 1.2.7
python-extension-pack don 1.7.0
remote-containers ms- 0.427.0
remote-explorer ms- 0.5.0
remote-ssh ms- 0.120.0
remote-ssh-edit ms- 0.87.0
ruff cha 2025.26.0
sonokai sai 0.2.9
vsc-python-indent Kev 1.21.0
vscode-containers ms- 2.1.0
vscode-django bat 1.15.0
vscode-docker ms- 2.0.0
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-pylance ms- 2025.8.2
vscode-python-envs ms- 1.2.0
vscode-yaml red 1.18.0
vscodeintellicode Vis 1.3.2
System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 969)
GPU Status 2d_canvas: unavailable_software
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: unavailable_software
Load (avg) 1, 2, 2
Memory (System) 15.32GB (2.24GB free)
Process Argv --crash-reporter-id 06afb7ac-b267-443c-b12f-8f93fcba104d
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
vscrpc:30673769
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
aj953862:31281341
nesew2to5:31336538
cs4_fixed:31388788
nes-set-on:31351930
6abeh943:31336334
0927b901:31350571
ovs_t:31383295
0cj2b977:31352657
gendocstringt:31387974
cloudbuttont:31379625
todos-1:31384886
3efgi100_wstrepl:31382709
metis-embeddings:31388492
trigger-command-fix:31379601
gemagent1cf:31387343

Metadata

Metadata

Assignees

Labels

ai-triage-respondedIndicate whether the AI triage agent has responded to this issue.team needs to reproduceIssue has not been reproduced yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions