diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-07 20:14:14 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-07 20:14:14 +0800 |
commit | 15a7b101e2556a60288bb8f9066caf132c8cce13 (patch) | |
tree | e2d9c3802b71e498f3e6670e78fc4e1355add9fe /script/provider | |
parent | 7b73b1e47496b84e41bc10ed9a7d7f0f0d0a80d3 (diff) | |
download | lua-language-server-15a7b101e2556a60288bb8f9066caf132c8cce13.zip |
fix
Diffstat (limited to 'script/provider')
-rw-r--r-- | script/provider/provider.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 010bc24e..fd8e113c 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -244,11 +244,13 @@ proto.on('textDocument/definition', function (params) if targetUri then local targetLines = files.getLines(targetUri) local targetText = files.getText(targetUri) - response[i] = define.locationLink(targetUri - , define.range(targetLines, targetText, info.target.start, info.target.finish) - , define.range(targetLines, targetText, info.target.start, info.target.finish) - , define.range(lines, text, info.source.start, info.source.finish) - ) + if targetLines then + response[i] = define.locationLink(targetUri + , define.range(targetLines, targetText, info.target.start, info.target.finish) + , define.range(targetLines, targetText, info.target.start, info.target.finish) + , define.range(lines, text, info.source.start, info.source.finish) + ) + end end end return response |