diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-24 14:08:22 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-24 14:08:22 +0800 |
commit | 3f9ca58f22eeccd30ff1093c9874bfa79d40a29f (patch) | |
tree | b586b48634be67e11da684deff9dfac33d3e5d68 /server/test/crossfile/definition.lua | |
parent | a723536198162aef5297fa7dc05d20597895bda8 (diff) | |
download | lua-language-server-3f9ca58f22eeccd30ff1093c9874bfa79d40a29f.zip |
换个require的做法
Diffstat (limited to 'server/test/crossfile/definition.lua')
-rw-r--r-- | server/test/crossfile/definition.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/test/crossfile/definition.lua b/server/test/crossfile/definition.lua index 43261771..11d5f746 100644 --- a/server/test/crossfile/definition.lua +++ b/server/test/crossfile/definition.lua @@ -38,14 +38,14 @@ function TEST(data) local sourceScript, sourceList = catch_target(data[2].content, '?') local sourceUri = ws:uriEncode(fs.path(data[2].path)) - lsp:saveText(targetUri, 1, targetScript) lsp:saveText(sourceUri, 1, sourceScript) - ws:addFile(targetUri) ws:addFile(sourceUri) - lsp:compileVM(targetUri) - lsp:compileVM(sourceUri) + lsp:saveText(targetUri, 1, targetScript) + ws:addFile(targetUri) + lsp:compileAll() + lsp:compileAll() - local sourceVM = lsp:loadVM(sourceUri) + local sourceVM = lsp:getVM(sourceUri) assert(sourceVM) local sourcePos = (sourceList[1][1] + sourceList[1][2]) // 2 local positions = matcher.definition(sourceVM, sourcePos) |