Open supernova-III opened 1 year ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.76.2. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.76.2. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
I have updated my vscode to the latest stable version. The problem still exists.
I found that this problem is not there if Auto Indent is disabled
Just for logging:
1 year passed
Hi @supernova-III thank you for posting this issue. Yes this is an issue which applies to other languages as well, as it happens because indentation is generally based on the indentation of the first non-whitespace line directly above. In your case, the line directly above is indented with four spaces and so the next line is too. To fix this, which we would like to do at some point, we need to make the indentation code aware of the scopes of the code and make the indentation consistent across scope levels. Currently we are discussing using tree sitter in order to add this information.
@aiday-mar this is a great idea, thank you!
Is there any one still tracking this problem? It's frustrating of having more indentation for functions with long parameter list and long condition chains of 'if' statement. If there is a topic about this, I want to vote for it.
@HuazyYang I'm still here :-) Counting years before it gets resolved.
Issue Type: Bug
Hi there!
I have such piece of code (code indentation is 4 spaces):
And I get weird indentation when I put my cursor between curly braces and press Enter:
But I would expect
Now with the second piece of code, if I put my cursor after opening curly brace and hit enter, my cursor gets to this weird position:
It seems like it applies my indentation rules (4 spaces), but the code gets aligned to
char* cmdline
. So I always have to fix it manually. What should I do so that it will indent in expected way?I'm using clang-format:
VS Code version: Code 1.67.1 (da15b6fd3ef856477bf6f4fb29ba1b7af717770d, 2022-05-06T12:37:03.389Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No
System Info
|Item|Value| |---|---| |CPUs|AMD Ryzen 7 5700U with Radeon Graphics (16 x 1797)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|14.82GB (6.62GB free)| |Process Argv|. --crash-reporter-id 01a67f4c-d55c-40f4-b58a-c4b2f80741d9| |Screen Reader|no| |VM|0%|
Extensions (13)
Extension|Author (truncated)|Version ---|---|--- markdown-mermaid|bie|1.15.3 vscode-glsllint|dto|1.8.0 go|gol|0.38.0 mesonbuild|mes|1.7.1 python|ms-|2022.8.1 vscode-pylance|ms-|2023.1.10 nas-vscode|rig|0.0.1 rust-analyzer|rus|0.3.1443 shader|sle|1.1.5 cmake|twx|0.0.17 vim|vsc|1.24.3 clang-format|xav|1.9.0 markdown-all-in-one|yzh|3.5.0 (2 theme extensions excluded)