Skip to content

textDocument/rename reports positions outside of the document #413

@davschul

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 }

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