Skip to content

Extra newlines in incorrect format (CRLF) cause wrong LSP highlight locations #460

@space-nuko

Description

@space-nuko

When submitting issues to this project, please include the following information.

Checklist

  • I have searched both open and closed issues and cannot find a duplicate.
  • I can reproduce the problem with the latest version of the relevant packages.
  • The problem still occurs after I issued M-x tide-restart-server in the buffer where I had the problem.
  • I verified that the version and the configuration file path reported by M-x tide-verify-setup are correct.
  • If tide is reporting an error or warning I think should not be reported, I can run tsc (and tslint, if applicable) without the error or warning I'm seeing in tide.
  • If tide is not reporting an error or warning I think should be reported, tsc (or tslint, if applicable) reports the error or warning I was expecting to see.
  • I am positive the problem does not belong to typescript-mode or tsserver.

Relevant Version Numbers

  • Tide: 4.5.4
  • TypeScript:5.0.3
  • Emacs: 29.0.50

(The list above is minimal. Make sure to include any other version numbers relevant to your report.)

Steps to Reproduce the Bug

I noticed that if my document formatted with LF contains an extra CRLF somewhere (^M) then the highlights become offset and wrong.
2023-04-06 00_51_14-LGraphCanvas ts – Doom Emacs
2023-04-06 00_51_01-LGraphCanvas ts – Doom Emacs

Expected Behavior

Highlights should work

Actual Behavior

The highlights are incorrect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions