diff options
-rw-r--r-- | script-beta/core/document-symbol.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/script-beta/core/document-symbol.lua b/script-beta/core/document-symbol.lua index d7eb59ea..56d0dfbc 100644 --- a/script-beta/core/document-symbol.lua +++ b/script-beta/core/document-symbol.lua @@ -7,12 +7,16 @@ local util = require 'utility' local function buildName(source, text) if source.type == 'setmethod' or source.type == 'getmethod' then - return text:sub(source.start, source.method.finish) + if source.method then + return text:sub(source.start, source.method.finish) + end end if source.type == 'setfield' or source.type == 'tablefield' or source.type == 'getfield' then - return text:sub(source.start, source.field.finish) + if source.field then + return text:sub(source.start, source.field.finish) + end end return text:sub(source.start, source.finish) end |