microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.94k stars 29.18k forks source link

[folding] selecting first line of folded range does not select full folded range #72422

Open terradek opened 5 years ago

terradek commented 5 years ago

Issue Type: Bug

  1. Create a variable with an array
  2. Collapse the array
  3. Mark the line with the array and copy it
  4. Paste below

Actual result: the only array name with open bracket is copied

Expected result: whole array is copied

PFA

VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:20:22.771Z) OS version: Linux x64 4.15.0-47-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz (4 x 3708)| |GPU Status|2d_canvas: disabled_software
checker_imaging: disabled_off
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: disabled_off
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: disabled_off
video_decode: disabled_software
webgl: disabled_off
webgl2: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|31.35GB (12.71GB free)| |Process Argv|--unity-launch| |Screen Reader|no| |VM|0%|
Extensions (40) Extension|Author (truncated)|Version ---|---|--- output-colorizer|IBM|0.1.2 pgformatter|bra|1.6.5 better-toml|bun|0.3.2 npm-intellisense|chr|1.3.0 path-intellisense|chr|1.4.2 bracket-pair-colorizer|Coe|1.0.61 systemd-unit-file|coo|1.0.3 vscode-markdownlint|Dav|0.26.0 vscode-eslint|dba|1.8.2 pgsql|dou|0.1.3 gitlens|eam|9.6.0 tslint|eg2|1.0.43 vscode-npm-script|eg2|0.3.5 LogFileHighlighter|emi|2.4.3 vsc-material-theme|Equ|2.8.2 vscode-postman|eri|0.5.2 gauge|get|0.0.3 gc-excelviewer|Gra|2.1.32 vscode-nginx-conf-hint|han|0.1.0 beautify|Hoo|1.4.11 js-test-gen-vscode|jsT|0.5.0 ldif|jta|0.1.1 vscode-regexp-preivew|le0|0.0.3 terraform|mau|1.3.9 git-graph|mhu|1.4.5 Go|ms-|0.9.2 sqltools|mtx|0.17.15 makefiles-support-for-vscode|nae|0.0.3 vscode-json-transform|oct|0.1.2 vscode-docker|Pet|0.6.1 vscode-versionlens|pfl|0.22.0 vscode-yaml|red|0.4.0 vscode-sort-json|ric|1.13.0 vscode-statusbar-json-path|ric|1.2.0 monitor-file|rko|1.0.1 sql-snippets|sad|0.0.4 vscode-sql-beautify|sen|0.0.4 slim|sia|0.1.2 language-stylus|sys|1.11.0 vscode-ansible|vsc|0.5.2 (3 theme extensions excluded)

collapsed_array_issue-2019-04-16_18.06.33.mp4.zip

aeschli commented 5 years ago

You need to select until after the folded range.

The current behaviour is as designed, but I as others have requested the same, I'll keep it open for votes

mika76 commented 4 years ago

Coming from the issue that was just closed. I just don't see the benefit of it working as is.

Visually and conceptually if you select a whole line which has been folded the expectation is for your action to work on the whole fold. Just as in visual studio the ide.

mika76 commented 4 years ago

Just playing with it some more - one other thing I do (used to doing it from VS IDE) is to go to a folded line or region, click end to go to the end of the line and then press enter to make a new method or whatever.

That also fails since it opens the fold and then add a new line under the first line of the folded code.

It just does not feel intuitive as is - while VS IDE seems to get it right.