Skip to content

Commit 837b139

Browse files
committed
fix #346 dont modify the cache
1 parent 8209df6 commit 837b139

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# changelog
22

3+
## 1.11.2
4+
* `FIX` [#346](https://github.com/sumneko/lua-language-server/issues/346): dont modify the cache
5+
36
## 1.11.1
47
`2021-1-5`
58
* `CHG` performance optimization

script/core/hover/description.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ local function asStringInRequire(source, literal)
2525
result = ws.findUrisByFilePath(literal)
2626
end
2727
if result and #result > 0 then
28+
local shows = {}
2829
for i, uri in ipairs(result) do
2930
local searcher = searchers and searchers[uri]
3031
uri = files.getOriginUri(uri)
@@ -34,19 +35,19 @@ local function asStringInRequire(source, literal)
3435
end
3536
path = path:gsub('^[/\\]*', '')
3637
if vm.isMetaFile(uri) then
37-
result[i] = ('* [[meta]](%s)'):format(uri)
38+
shows[i] = ('* [[meta]](%s)'):format(uri)
3839
elseif searcher then
3940
searcher = searcher:sub(#rootPath + 1)
4041
searcher = ws.normalize(searcher)
4142
searcher = searcher:gsub('^[/\\]+', '')
42-
result[i] = ('* [%s](%s) %s'):format(path, uri, lang.script('HOVER_USE_LUA_PATH', searcher))
43+
shows[i] = ('* [%s](%s) %s'):format(path, uri, lang.script('HOVER_USE_LUA_PATH', searcher))
4344
else
44-
result[i] = ('* [%s](%s)'):format(path, uri)
45+
shows[i] = ('* [%s](%s)'):format(path, uri)
4546
end
4647
end
47-
table.sort(result)
48+
table.sort(shows)
4849
local md = markdown()
49-
md:add('md', table.concat(result, '\n'))
50+
md:add('md', table.concat(shows, '\n'))
5051
return md:string()
5152
end
5253
end

0 commit comments

Comments
 (0)