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

single-line block comments incorrectly indented #77474

Closed
JonathanMEdwards opened this issue Jul 16, 2019 · 4 comments
Closed

single-line block comments incorrectly indented #77474

JonathanMEdwards opened this issue Jul 16, 2019 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues help wanted Issues identified as good community contribution opportunities javascript JavaScript support issues typescript Typescript support issues

Comments

@JonathanMEdwards
Copy link
Contributor

Issue Type: Bug

create ts/js file:

class foo {
  /* */
}

place cursor to right of */
hit return
you get:

class foo {
/* */
  
}

VS Code version: Code 1.36.1 (2213894, 2019-07-08T22:56:38.504Z)
OS version: Darwin x64 18.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (1.20GB free)
Process Argv --disable-extensions
Screen Reader no
VM 0%
Extensions disabled
@vscodebot vscodebot bot added the editor-contrib Editor collection of extras label Jul 16, 2019
@mjbvz mjbvz self-assigned this Jul 16, 2019
@mjbvz mjbvz added editor-autoindent Editor auto indentation issues help wanted Issues identified as good community contribution opportunities javascript JavaScript support issues typescript Typescript support issues labels Aug 16, 2019
@alexdima alexdima removed the editor-contrib Editor collection of extras label Jan 19, 2020
@joaomoreno
Copy link
Member

I can't repro this, @JonathanMEdwards can you still see this?

@JonathanMEdwards
Copy link
Contributor Author

Yes, still happens, exactly as described.

CPUs Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 3, 2, 2
Memory (System) 16.00GB (1.04GB free)
Process Argv -psn_0_11037318
Screen Reader no
VM 0%

Extension Author (truncated) Version
npm-intellisense chr 1.3.0
gitignore cod 0.6.0
vscode-npm-script eg2 0.3.11
latex-workshop Jam 8.8.0
theme-dark-plus-contrast k3a 0.1.101
debugger-for-chrome msj 4.12.6
deepdark-material Nim 3.2.1
vscode-jest Ort 3.1.1
vscodeintellicode Vis 1.2.6
markdown-all-in-one yzh 2.7.0

@rebornix
Copy link
Member

rebornix commented Nov 3, 2020

This is due to the limited architecture (regex based indentation rules and only support limited code styles), we may want to consider using formatters if they exist for indenation adjustment (if interested, we can discuss in #19847).

For this particular issue, you can set editor.autoIndent to advanced to disable the regex based indentation adjustment or use auto formatting (editor.formatOnType, editor.formatOnPaste). As we don't have an easy good-enough fix for it, we close it for now and explore better solutions through issues like (#19847, #34621 or #66235).

@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Nov 3, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 6, 2021

Closing this in favor of the other issues mentioned as I don't think it's possible to fix this without some new APIs

@mjbvz mjbvz closed this as completed Oct 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues help wanted Issues identified as good community contribution opportunities javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

5 participants