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

about the "Format On Save" #211214

Closed
DeYuanGeGe opened this issue Apr 24, 2024 · 6 comments
Closed

about the "Format On Save" #211214

DeYuanGeGe opened this issue Apr 24, 2024 · 6 comments
Assignees
Labels
formatting Source formatter issues info-needed Issue requires more information from poster

Comments

@DeYuanGeGe
Copy link

DeYuanGeGe commented Apr 24, 2024

Type: Bug

I have selected the "Format On Save" in User > Text Editor > Formatting
my code :

<style lang="scss"> // .kcool, // .kdark { // .chkimg { // background-color: #999; // } // } </style>

issues - the last code line be comment yet
when I Ctrl + S save the code ,the code will be change to:

<style lang="scss"> // .kcool, // .kdark { // .chkimg { // background-color: #999; // } // }</style>

VS Code version: Code 1.88.1 (e170252, 2024-04-10T17:41:02.734Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (6 x 3000)
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
Load (avg) undefined
Memory (System) 15.80GB (2.36GB free)
Process Argv --crash-reporter-id c9c6de36-38a8-4ab2-ac4a-892e7f9ced97
Screen Reader no
VM 0%
Extensions (8)
Extension Author (truncated) Version
comment-tagged-templates bie 0.3.3
path-intellisense chr 2.8.5
shell-format fox 7.2.5
vue-snippets hol 1.0.4
remote-wsl ms- 0.88.0
webgl-glsl-editor rac 1.3.8
shader sle 1.1.5
volar Vue 2.0.8
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r3:30993541
dsvsc020:30976470
pythonait:31006305
jchc7451:30973076
gee8j676:31009558
dsvsc021:30996838
da93g388:31013173
pythoncenvpt:31022790

@RobinWragg
Copy link

@DeYuanGeGe May I suggest using code sections in your comment, or posting screenshots? It should show the formatting problem more clearly.

@jrieken
Copy link
Member

jrieken commented Apr 24, 2024

For me it is being formatted into this ⬇️ which seems correct to me

<style lang="scss">
	// .kcool, // .kdark { // .chkimg { // background-color: #999; // } // } 
</style>

@jrieken jrieken added info-needed Issue requires more information from poster formatting Source formatter issues labels Apr 24, 2024
@jrieken
Copy link
Member

jrieken commented Apr 24, 2024

Can you update your steps or attach a recording?

@DeYuanGeGe
Copy link
Author

for example, my scss code like that:
sample1
but ,when I Ctrl + S save the code , the code will be change to :
sample2
and so I test some time, find, only comment the last line code , can trigger the bug.
the bug only find in <style lang="scss"></style>
test1

@IllusionMH
Copy link
Contributor

Is it reproducible with all extensions disabled?
You can try this with F1 and >Developer: Reload Window With Extensions Disabled

Looks like issue with Volar extension, as VS Code doesn't support .vue files out of the box and should not format these files at all.

Or you can go for full troubleshooting F1 and > Help: Troubleshoot Issue

@IllusionMH
Copy link
Contributor

Please use English, so content would be accessible for devs and other users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatting Source formatter issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants