microsoft / vscode

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

enter and automatic indentataion #165153

Open Mahammad249 opened 1 year ago

Mahammad249 commented 1 year ago

Type: Bug

when i press the enter key after a tag or a function it doesn`t make the automatic indentation i used to

VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:15:18.074Z) OS version: Windows_NT x64 10.0.19044 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (8 x 2112)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|7.84GB (3.80GB free)| |Process Argv|--crash-reporter-id 0cbe3a7a-c7eb-40fc-b739-9a7ee6d52cad| |Screen Reader|no| |VM|0%|
Extensions (32) Extension|Author (truncated)|Version ---|---|--- rainbow-brackets|2gu|0.0.6 vscode-django|bat|1.10.0 blackbox|Bla|0.3.5 vscode-html-css|ecm|1.13.1 vsc-material-theme|Equ|33.5.0 vsc-material-theme-icons|equ|2.4.0 prettier-vscode|esb|9.9.0 vscode-firefox-debug|fir|2.9.8 auto-rename-tag|for|0.1.10 code-runner|for|0.11.8 live-sass|gle|5.5.1 rest-client|hum|0.25.1 tab-indent-space-align|j-z|0.0.3 fluent-icons|mig|0.0.18 python|ms-|2022.16.1 vscode-pylance|ms-|2022.10.40 jupyter|ms-|2022.9.1202862440 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.10 vscode-jupyter-cell-tags|ms-|0.1.6 vscode-jupyter-slideshow|ms-|0.1.5 indent-rainbow|ode|8.3.1 material-icon-theme|PKi|4.21.0 material-product-icons|PKi|1.4.1 vscode-css-peek|pra|4.2.0 LiveServer|rit|5.7.9 vscode-field-lights|sve|0.0.11 sass-indented|syl|1.8.22 ayu|tea|1.0.5 bootstrap4-vscode|the|6.1.0 vscode-icons|vsc|12.0.1 JavaScriptSnippets|xab|1.8.0 (6 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 pyindex848:30577860 nodejswelcome1:30587005 fc301958:30595537 2e4cg342:30596373 ```
ninmonkey commented 1 year ago
Mahammad249 commented 1 year ago

Python And HTML when I finish writing a tag or a function and I het enter their must be a automatic indentation right now and I have been a while suffering with it please help

On Tue, 1 Nov 2022, 10:40 pm Jake Bolton, @.***> wrote:

  • Where, and what is changing? The text editor?, the powershell console, etc
  • Which language is loaded?
  • check the sidebar , extensions sometimes auto-update, breaking things like completion until you reload

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/165153#issuecomment-1299111758, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3575MS4V7DPC7GZ4WTWDE3WGF55TANCNFSM6AAAAAARUBCZ4Y . You are receiving this because you authored the thread.Message ID: @.***>

rebornix commented 1 year ago

@Mahammad249 can you try to update auto indent setting editor.autoIndent to advanced to see if it helps? You can also experiment with other values to see which one is close to what you used to have.

VSCodeTriageBot commented 1 year ago

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

Mahammad249 commented 1 year ago

Ok I will try that

On Wed, 2 Nov 2022, 2:23 am Peng Lyu, @.***> wrote:

@Mahammad249 https://github.com/Mahammad249 can you try to update auto indent setting editor.autoIndent to advanced to see if it helps? You can also experiment with other values to see which one is close to what you used to have.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/165153#issuecomment-1299387423, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3575MWUMEFT7DRICBULTCLWGGX6VANCNFSM6AAAAAARUBCZ4Y . You are receiving this because you were mentioned.Message ID: @.***>

Mahammad249 commented 1 year ago

It doesn't do anything unfortunately

On Wed, 2 Nov 2022, 2:23 am Peng Lyu, @.***> wrote:

@Mahammad249 https://github.com/Mahammad249 can you try to update auto indent setting editor.autoIndent to advanced to see if it helps? You can also experiment with other values to see which one is close to what you used to have.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/165153#issuecomment-1299387423, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3575MWUMEFT7DRICBULTCLWGGX6VANCNFSM6AAAAAARUBCZ4Y . You are receiving this because you were mentioned.Message ID: @.***>

rebornix commented 1 year ago

Can you please try disabling all extension by running code --disable-extensions and see if you can still reproduce?

Mahammad249 commented 1 year ago

Ok, I will try.

On Tue, 13 Dec 2022, 2:32 am Peng Lyu, @.***> wrote:

Can you please try disabling all extension by running code --disable-extensions and see if you can still reproduce?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/165153#issuecomment-1347575485, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3575MS6VO6VBH3YYSEGOH3WM67ZTANCNFSM6AAAAAARUBCZ4Y . You are receiving this because you were mentioned.Message ID: @.***>

Mahammad249 commented 1 year ago

Still not working

On Tue, 13 Dec 2022, 2:32 am Peng Lyu, @.***> wrote:

Can you please try disabling all extension by running code --disable-extensions and see if you can still reproduce?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/165153#issuecomment-1347575485, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3575MS6VO6VBH3YYSEGOH3WM67ZTANCNFSM6AAAAAARUBCZ4Y . You are receiving this because you were mentioned.Message ID: @.***>

DanTup commented 3 months ago

@rebornix I've had a report of what seems like the same issue here for Dart https://github.com/Dart-Code/Dart-Code/issues/5141. Oddly I cannot reproduce the issue, even with the same editor.autoIdent setting.

For me, VS Code always indents if I press <enter> at the location of ^ in this code:

void f() {^}

But for this user, it does not. I'm not specifying any onEnter rules to handle this because I presume VS Code has its own magic, but it's not clear to me what that is.

Are you able to point me to where VS Codes rules are for doing this automatically?

Edit: nevermind, this turned out to be because of editor.language.brackets being empty for this user.