Skip to content

textDocument/rename reports positions outside of the document #413

Closed

Description

@davschul

When having a document that ends without a trailing newline 'textDocument/rename' reports a document change that contains a position outside of the document as the end position. For example a document just containing of:
foo=12

Ttriggering a rename on the beginning of foo with the replacement bar results in the following edits:
"edits": [ { "newText": "bar = 12", "range": { "end": { "character": 0, "line": 1 }, "start": { "character": 0, "line": 0 } } } ],

But the document just has one line, line 1 is out of the document scope. Expected would be
"end": { "character": 6, "line": 0 }

Activity

  1. ccordoba12 commented on Aug 9, 2023

    @ccordoba12
    Member

    Thanks for reporting @davschul. Could you submit a pull request to fix this?

  2. added this to the v1.8.0 milestone on Aug 9, 2023
  3. modified the milestones: v1.8.0, v1.8.1 on Sep 6, 2023
  4. self-assigned this
    on Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions