File tree 3 files changed +65
-22
lines changed
3 files changed +65
-22
lines changed Original file line number Diff line number Diff line change 1
1
# changelog
2
2
3
3
## 2.5.4
4
+ * ` FIX ` [ #847 ] ( https://github.com/sumneko/lua-language-server/issues/847 )
4
5
* ` FIX ` [ #848 ] ( https://github.com/sumneko/lua-language-server/issues/848 )
5
6
* ` FIX ` completion: incorrect cache
6
7
* ` FIX ` hover: always view string
Original file line number Diff line number Diff line change @@ -60,10 +60,8 @@ function m.getVisiblePath(path)
60
60
pos = currentPath :match (' [/\\ ]+()' , pos )
61
61
if platform .OS == ' Windows' then
62
62
searcher = searcher :gsub (' [/\\ ]+' , ' \\ ' )
63
- :gsub (' ^[/\\ ]+' , ' ' )
64
63
else
65
64
searcher = searcher :gsub (' [/\\ ]+' , ' /' )
66
- :gsub (' ^[/\\ ]+' , ' ' )
67
65
end
68
66
local expect = getOnePath (cutedPath , searcher )
69
67
if expect then
Original file line number Diff line number Diff line change @@ -891,25 +891,69 @@ print(t.<?x?>)
891
891
}
892
892
}
893
893
894
- -- config.set('Lua.runtime.path', {
895
- -- '/home/?.lua'
896
- -- })
897
- -- TEST {
898
- -- {
899
- -- path = '/home/a.lua',
900
- -- content = [[
901
- -- return {
902
- -- <!x!> = 1,
903
- -- }
904
- -- ]],
905
- -- },
906
- -- {
907
- -- path = 'b.lua',
908
- -- content = [[
909
- -- local t = require 'a'
910
- -- print(t.<?x?>)
911
- -- ]]
912
- -- }
913
- -- }
894
+ config .set (' Lua.runtime.path' , {
895
+ ' /home/?.lua'
896
+ })
897
+ TEST {
898
+ {
899
+ path = ' /home/a.lua' ,
900
+ content = [[
901
+ return {
902
+ <!x!> = 1,
903
+ }
904
+ ]] ,
905
+ },
906
+ {
907
+ path = ' b.lua' ,
908
+ content = [[
909
+ local t = require 'a'
910
+ print(t.<?x?>)
911
+ ]]
912
+ }
913
+ }
914
914
915
+ config .set (' Lua.runtime.pathStrict' , true )
916
+ config .set (' Lua.runtime.path' , {
917
+ ' ./?.lua'
918
+ })
919
+ TEST {
920
+ {
921
+ path = ' a.lua' ,
922
+ content = [[
923
+ return {
924
+ <!x!> = 1,
925
+ }
926
+ ]] ,
927
+ },
928
+ {
929
+ path = ' b.lua' ,
930
+ content = [[
931
+ local t = require 'a'
932
+ print(t.<?x?>)
933
+ ]]
934
+ }
935
+ }
936
+
937
+ config .set (' Lua.runtime.path' , {
938
+ ' /home/?.lua'
939
+ })
940
+ TEST {
941
+ {
942
+ path = ' /home/a.lua' ,
943
+ content = [[
944
+ return {
945
+ <!x!> = 1,
946
+ }
947
+ ]] ,
948
+ },
949
+ {
950
+ path = ' b.lua' ,
951
+ content = [[
952
+ local t = require 'a'
953
+ print(t.<?x?>)
954
+ ]]
955
+ }
956
+ }
957
+
958
+ config .set (' Lua.runtime.pathStrict' , false )
915
959
config .set (' Lua.runtime.path' , originRuntimePath )
You can’t perform that action at this time.
0 commit comments