Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug] #5429

Description

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.55.1#XQAAAAJ8AAAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscjtPHiSSzE4WUfroqWVtW5X_5X2Eu1DcEHUGBUpzkgp7MHVn16NTpxO4etzyW0R3-SXvNP__5c0AA

Monaco Editor Playground Code

function alpha() { 
	;
}

function beta() { //Comment
;
}

Reproduction Steps

  1. Paste the following code in the playground:
function alpha() { 
}

function beta() { //Comment
}
  1. Place the cursor at the end of the line with alpha() function header.
  2. Press Enter.
  3. There is an auto-indentation for the function body
  4. Now, pace the cursor at the end of the line with beta() function header.
  5. Press Enter.
  6. There is not an auto-indentation.

Actual (Problematic) Behavior

A trailing comment on the function header prevents Monaco from applying the auto-indentation.

Expected Behavior

Both of the function bodies should receive the auto-indentation.

Additional Context

The equivalent bug exists for the following languages, checked on the Home page of Monaco:

  • Python
  • C
  • C#
  • Java
  • Go
  • PHP
  • Rust

I have only verified these languages so far, therefore the list should not be considered exhaustive.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugeditor-indent-detection

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions