diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-29 13:27:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-29 13:27:28 +0800 |
commit | ea45861759cb00143552a7469fdc7a0b48cb7225 (patch) | |
tree | da168707b03879fe23afd6c12bdaa8bf38add3eb | |
parent | 9036106b25eeee7553d28a1b4f5e27d78ab5287c (diff) | |
download | lua-language-server-ea45861759cb00143552a7469fdc7a0b48cb7225.zip |
判空
-rw-r--r-- | server/src/core/document_symbol.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/core/document_symbol.lua b/server/src/core/document_symbol.lua index f53e636d..e9d025db 100644 --- a/server/src/core/document_symbol.lua +++ b/server/src/core/document_symbol.lua @@ -50,7 +50,7 @@ local function buildFunction(vm, func) end local hvr = hoverFunction(name, func, declarat and declarat.object) if not hvr then - return + return nil end local selectionRange local range @@ -113,6 +113,9 @@ local function buildVar(vm, var) range = { var.source.start, var.source.finish } end local hvr = hover(var, var.source) + if not hvr then + return nil + end local kind if var.source.isIndex then kind = SymbolKind.Class |