Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textDocument/rename reports positions outside of the document #413

Closed
davschul opened this issue Aug 9, 2023 · 1 comment · Fixed by #450
Closed

textDocument/rename reports positions outside of the document #413

davschul opened this issue Aug 9, 2023 · 1 comment · Fixed by #450
Assignees
Labels
bug Something isn't working
Milestone

Comments

@davschul
Copy link

davschul commented Aug 9, 2023

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 }

cristianadam pushed a commit to cristianadam/qt-creator that referenced this issue Aug 9, 2023
upstream bug report:
python-lsp/python-lsp-server#413

Fixes: QTCREATORBUG-29389
Change-Id: I5b122b5e5c245cb5c43c32da1296b2132a07a9aa
@ccordoba12
Copy link
Member

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

@ccordoba12 ccordoba12 added this to the v1.8.0 milestone Aug 9, 2023
@ccordoba12 ccordoba12 added the bug Something isn't working label Aug 9, 2023
qtprojectorg pushed a commit to qt-creator/qt-creator that referenced this issue Aug 22, 2023
upstream bug report:
python-lsp/python-lsp-server#413

Fixes: QTCREATORBUG-29389
Change-Id: I5b122b5e5c245cb5c43c32da1296b2132a07a9aa
Reviewed-by: Christian Stenger <[email protected]>
@ccordoba12 ccordoba12 modified the milestones: v1.8.0, v1.8.1 Sep 6, 2023
@ccordoba12 ccordoba12 self-assigned this Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants