Skip to content

Executing vscode.executeFormatDocumentProvider with HTML files can return end range exceeding file length #175298

@allisonchou

Description

@allisonchou

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.76.0-insider
  • OS Version: Windows 11

Using the built-in command vscode.executeFormatDocumentProvider (spec'd here) using an HTML URI can return a range that exceeds the length of the source file.

For example, invoking the above command on a completely empty HTML file will return a range of (startPosition: (0, 0); endPosition: (1, 0)) despite there only being one line in the file. This has caused several bugs to be filed on the Razor team. We've implemented a workaround for now, but we hope to have this issue formally fixed in the near future.

Metadata

Metadata

Assignees

Labels

formattingSource formatter issuesunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions