From 777eecd9e4dfd17395590d72f8312b53831c0e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 28 Dec 2018 17:37:35 +0800 Subject: =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=B8=8D=E6=8E=A5=E5=8F=97=E7=A9=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/documentSymbol.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/src') 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 -- cgit v1.2.3