diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-11 17:18:59 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-11 17:18:59 +0800 |
commit | d9048f6219277534d20669fbfd77d62bb572000e (patch) | |
tree | 2859d7fc126a4cc713dbd0fbbef58833b7893368 /script-beta/core/completion.lua | |
parent | b07c6d80e23dea035853b89d22513d73df1aadbc (diff) | |
download | lua-language-server-d9048f6219277534d20669fbfd77d62bb572000e.zip |
自动完成支持 . 与 : 扩展field
Diffstat (limited to 'script-beta/core/completion.lua')
-rw-r--r-- | script-beta/core/completion.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua index b0f15f74..d5ce0d9a 100644 --- a/script-beta/core/completion.lua +++ b/script-beta/core/completion.lua @@ -75,6 +75,8 @@ local function findSymbol(text, offset) or char == ':' or char == '#' then return char, i + else + return nil end ::CONTINUE:: end @@ -474,10 +476,6 @@ local function checkKeyWord(ast, text, start, word, results) end end -local function checkDot(ast, start, results) - -end - local function tryWord(ast, text, offset, results) local word, start = findWord(text, offset) if not word then @@ -508,8 +506,12 @@ local function trySymbol(ast, text, offset, results) if isInString(ast, offset) then return nil end - if symbol == '.' then - checkDot(ast, start, results) + if symbol == '.' + or symbol == ':' then + local parent, oop = findParent(ast, text, start) + if parent then + checkField('', start, parent, oop, results) + end end end |