Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Format Selection" formats code outside the selected range on Visual Studio Code #3567

Open
qiyana-ratchet opened this issue Nov 7, 2024 · 0 comments

Comments

@qiyana-ratchet
Copy link

Type: Bug

Steps to Reproduce:

  1. Open a JavaScript file with code that needs formatting.
  2. Select a portion of the code by dragging the cursor over the desired section.
  3. Use the "Format Selection" feature, which should format only the selected code.
  4. Observe the result: instead of formatting only the selected code, the entire function (or the code outside the selection) is also formatted.
  5. Additionally, if the cursor is placed in the file without any selected range, the "Format Selection" feature behaves as "Format Document," formatting the entire file instead of the selected line or section.
  6. Expected behavior: Only the selected code range should be formatted.

Thank you.

Extension version: 11.0.0
VS Code version: Code 1.95.1 (65edc4939843c90c34d61f4ce11704f09d3e5cb6, 2024-10-31T05:14:54.222Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.4.0-200-generic

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 63.80GB (33.12GB free)
Process Argv --crash-reporter-id 7ecb8206-fb83-42b0-bcf0-55a8f65214d4
Screen Reader no
VM 0%
Item Value
Remote SSH: 192.168.56.120
OS Linux x64 5.4.0-200-generic
CPUs 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (4 x 0)
Memory (System) 15.62GB (7.16GB free)
VM 100%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
bdiig495:31013172
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31102340
nativerepl1:31139838
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
iacca1:31156133
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013

@qiyana-ratchet qiyana-ratchet changed the title "Format Selection" formats code outside the selected range "Format Selection" formats code outside the selected range on Visual Studio Code Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant