Skip to content

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

@allisonchou

Description

@allisonchou
  • 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

No one assigned

    Labels

    info-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions