From 6772d374dae53b5d43ea0354635fd37f26618d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 28 Jun 2021 14:37:12 +0800 Subject: fix #580 --- changelog.md | 3 +++ script/core/command/removeSpace.lua | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 5e8a86d3..857f685f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 2.0.5 +* `FIX` [#580](https://github.com/sumneko/lua-language-server/issues/580) + ## 2.0.4 `2021-6-25` * `FIX` [#550](https://github.com/sumneko/lua-language-server/issues/550) diff --git a/script/core/command/removeSpace.lua b/script/core/command/removeSpace.lua index 6fb9669f..2ef178f3 100644 --- a/script/core/command/removeSpace.lua +++ b/script/core/command/removeSpace.lua @@ -1,5 +1,4 @@ local files = require 'files' -local searcher = require 'core.searcher' local guide = require 'parser.guide' local proto = require 'proto' local lang = require 'language' @@ -23,10 +22,10 @@ return function (data) local textEdit = {} for i = 1, #lines do - local line = searcher.lineContent(lines, text, i, true) + local line = guide.lineContent(lines, text, i, true) local pos = line:find '[ \t]+$' if pos then - local start, finish = searcher.lineRange(lines, i, true) + local start, finish = guide.lineRange(lines, i, true) start = start + pos - 1 if isInString(ast, start) then goto NEXT_LINE -- cgit v1.2.3