From eaf41a1874f6d2fc2e7ce58c1be02f8bfedfb441 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 23 Jul 2023 07:09:24 +0200 Subject: [PATCH] Fix incorrect positions set in code action edits Neovim requires positions to supply column as well as row. --- src/Psalm/Internal/LanguageServer/Server/TextDocument.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/LanguageServer/Server/TextDocument.php b/src/Psalm/Internal/LanguageServer/Server/TextDocument.php index b9c4bcca8f4..076b7cb26f5 100644 --- a/src/Psalm/Internal/LanguageServer/Server/TextDocument.php +++ b/src/Psalm/Internal/LanguageServer/Server/TextDocument.php @@ -435,8 +435,8 @@ public function codeAction(TextDocumentIdentifier $textDocument, Range $range, C //$contents = $this->codebase->file_provider->getContents($file_path); $snippetRange = new Range( - new Position($data['line_from']-1), - new Position($data['line_to']), + new Position($data['line_from'] - 1, 0), + new Position($data['line_to'], 0), ); $indentation = '';