diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-28 17:37:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-28 17:37:35 +0800 |
commit | 777eecd9e4dfd17395590d72f8312b53831c0e67 (patch) | |
tree | d420a18ad6ce744abcb8cbaa2b4e1fe702cbdffa /server/src/method | |
parent | 023a8085524b1b6368722fd0b0485132c9dfb725 (diff) | |
download | lua-language-server-777eecd9e4dfd17395590d72f8312b53831c0e67.zip |
前端不接受空字符串
Diffstat (limited to 'server/src/method')
-rw-r--r-- | server/src/method/textDocument/documentSymbol.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/method/textDocument/documentSymbol.lua b/server/src/method/textDocument/documentSymbol.lua index fdfe832a..7484bb97 100644 --- a/server/src/method/textDocument/documentSymbol.lua +++ b/server/src/method/textDocument/documentSymbol.lua @@ -1,4 +1,5 @@ local core = require 'core' +local lang = require 'language' local function posToRange(lines, start, finish) local start_row, start_col = lines:rowcol(start) @@ -18,6 +19,9 @@ end local function convertRange(lines, symbol) symbol.range = posToRange(lines, symbol.range[1], symbol.range[2]) symbol.selectionRange = posToRange(lines, symbol.selectionRange[1], symbol.selectionRange[2]) + if symbol.name == '' then + symbol.name = lang.script.SYMBOL_ANONYMOUS + end if symbol.children then for _, child in ipairs(symbol.children) do |