Skip to content

🐛 Biome as auto-formatter in vscode, remoting from windows to macOS, mangles files #857

@jwatte

Description

@jwatte

VS Code version

1.106.0

Extension version

3.3.0

Biome version

2.3.2

Operating system

  • Windows
  • macOS
  • Linux

Description

When doing a remote connection (SSH) from vscode running on windows, to a git repo on macOS (a large monorepo managed by rush) I keep getting my typescript files mangled by the auto-formatting function of biome.

It gives seeming phantom errors about code that looks perfectly fine on the screen.
It also will just randomly delete code.
Finally, it will be confused about the size of the file.

Example error dialog:
Image

Example error print:

failed to access range Range { start: Position { line: 0, character: 0 }, end: Position { line: 1020, character: 0 } } in document file:///Users/jwatte/github.com/reve-ai/reve-core/backend/monolith/service/src/cronjobs/summarize-papi-usage-cron.ts LineIndex { newlines: [0, 71, 72, 106, 107, 174, 175, 255, 325, 416, 490, 598, 679, 688, 726, 748, 770, 795, 823, 845, 908, 965, 1035, 1093, 1149, 1209, 1330, 1331, 1423, 1495, 1504, 1538, 1579, 1617, 1660, 
...
34625, 34679, 34720, 34724, 34738, 34789, 34836, 34901, 34954, 34959, 34963, 34965, 34966, 35002, 35022, 35059, 35094, 35115, 35130, 35161, 35170, 35252, 35257, 35318, 35353, 35384, 35409, 35414, 35440, 35473, 35507, 35512, 35546, 35608, 35613, 35627, 35629], line_wide_chars: {} }

Caused by:
    position Position { line: 1020, character: 0 } is out of range

The actual file is 1021 lines long:

Image

Same problem happens with the prerelease version of the extension.

This vaguely smells like maybe LF vs CRLF confusion?

Steps to reproduce

Remote connect from vscode on Windows to macOS
Edit typescript files

Expected behavior

No code mangling, no confusion about how long files are.

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Link to a minimal reproduction

No response

Logs

See above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions