summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/libs/@lua/basic.lni66
-rw-r--r--server/libs/@lua/coroutine.lni8
-rw-r--r--server/libs/@lua/debug.lni20
-rw-r--r--server/libs/@lua/file.lni32
-rw-r--r--server/libs/@lua/io.lni68
-rw-r--r--server/libs/@lua/math.lni4
-rw-r--r--server/libs/@lua/os.lni16
-rw-r--r--server/locale/en-US/libs/@lua/basic.lni50
-rw-r--r--server/locale/en-US/libs/@lua/coroutine.lni8
-rw-r--r--server/locale/en-US/libs/@lua/debug.lni34
-rw-r--r--server/locale/en-US/libs/@lua/file.lni28
-rw-r--r--server/locale/en-US/libs/@lua/io.lni64
-rw-r--r--server/locale/en-US/libs/@lua/math.lni4
-rw-r--r--server/locale/zh-CN/libs/@lua/basic.lni50
-rw-r--r--server/locale/zh-CN/libs/@lua/coroutine.lni8
-rw-r--r--server/locale/zh-CN/libs/@lua/debug.lni34
-rw-r--r--server/locale/zh-CN/libs/@lua/file.lni28
-rw-r--r--server/locale/zh-CN/libs/@lua/io.lni64
-rw-r--r--server/locale/zh-CN/libs/@lua/math.lni4
-rw-r--r--server/src/core/completion.lua45
-rw-r--r--server/test/completion/init.lua72
21 files changed, 354 insertions, 353 deletions
diff --git a/server/libs/@lua/basic.lni b/server/libs/@lua/basic.lni
index 61db69c9..069bf0cd 100644
--- a/server/libs/@lua/basic.lni
+++ b/server/libs/@lua/basic.lni
@@ -23,29 +23,29 @@ optional = 'self'
[[.returns]]
[[.enums]]
name = 'opt'
-enum = 'collect'
+enum = '"collect"'
default = true
``````````
name = 'opt'
-enum = 'stop'
+enum = '"stop"'
``````````
name = 'opt'
-enum = 'restart'
+enum = '"restart"'
``````````
name = 'opt'
-enum = 'count'
+enum = '"count"'
``````````
name = 'opt'
-enum = 'step'
+enum = '"step"'
``````````
name = 'opt'
-enum = 'setpause'
+enum = '"setpause"'
``````````
name = 'opt'
-enum = 'setstepmul'
+enum = '"setstepmul"'
``````````
name = 'opt'
-enum = 'isrunning'
+enum = '"isrunning"'
["collectgarbage Lua 5.4"]
name = 'collectgarbage'
@@ -61,35 +61,35 @@ optional = 'self'
[[.returns]]
[[.enums]]
name = 'opt'
-enum = 'collect'
+enum = '"collect"'
default = true
``````````
name = 'opt'
-enum = 'stop'
+enum = '"stop"'
``````````
name = 'opt'
-enum = 'restart'
+enum = '"restart"'
``````````
name = 'opt'
-enum = 'count'
+enum = '"count"'
``````````
name = 'opt'
-enum = 'step'
+enum = '"step"'
``````````
name = 'opt'
-enum = 'setpause'
+enum = '"setpause"'
``````````
name = 'opt'
-enum = 'setstepmul'
+enum = '"setstepmul"'
``````````
name = 'opt'
-enum = 'incremental'
+enum = '"incremental"'
``````````
name = 'opt'
-enum = 'generational'
+enum = '"generational"'
``````````
name = 'opt'
-enum = 'isrunning'
+enum = '"isrunning"'
[dofile]
special = 'dofile'
@@ -184,13 +184,13 @@ name = 'error_message'
type = 'string'
[[.enums]]
name = 'mode'
-enum = 'b'
+enum = '"b"'
``````````
name = 'mode'
-enum = 't'
+enum = '"t"'
``````````
name = 'mode'
-enum = 'bt'
+enum = '"bt"'
default = true
['load Lua 5.1']
@@ -239,13 +239,13 @@ name = 'error_message'
type = 'string'
[[.enums]]
name = 'mode'
-enum = 'b'
+enum = '"b"'
``````````
name = 'mode'
-enum = 't'
+enum = '"t"'
``````````
name = 'mode'
-enum = 'bt'
+enum = '"bt"'
default = true
['loadfile Lua 5.1']
@@ -390,7 +390,7 @@ type = '...'
[[.returns]]
[[.enums]]
name = 'index'
-enum = '#'
+enum = '"#"'
``````````
name = 'index'
code = 'integer'
@@ -441,28 +441,28 @@ name = 'type'
type = 'string'
[[.enums]]
name = 'type'
-enum = 'nil'
+enum = '"nil"'
``````````
name = 'type'
-enum = 'number'
+enum = '"number"'
``````````
name = 'type'
-enum = 'string'
+enum = '"string"'
``````````
name = 'type'
-enum = 'boolean'
+enum = '"boolean"'
``````````
name = 'type'
-enum = 'table'
+enum = '"table"'
``````````
name = 'type'
-enum = 'function'
+enum = '"function"'
``````````
name = 'type'
-enum = 'thread'
+enum = '"thread"'
``````````
name = 'type'
-enum = 'userdata'
+enum = '"userdata"'
["_VERSION Lua 5.1"]
version = {'Lua 5.1', 'LuaJIT'}
diff --git a/server/libs/@lua/coroutine.lni b/server/libs/@lua/coroutine.lni
index 0006769f..c0c69a2c 100644
--- a/server/libs/@lua/coroutine.lni
+++ b/server/libs/@lua/coroutine.lni
@@ -87,16 +87,16 @@ name = 'status'
type = 'string'
[[.enums]]
name = 'status'
-enum = 'running'
+enum = '"running"'
``````````
name = 'status'
-enum = 'suspended'
+enum = '"suspended"'
``````````
name = 'status'
-enum = 'normal'
+enum = '"normal"'
``````````
name = 'status'
-enum = 'dead'
+enum = '"dead"'
[wrap]
[[.args]]
diff --git a/server/libs/@lua/debug.lni b/server/libs/@lua/debug.lni
index 07205552..63124ff8 100644
--- a/server/libs/@lua/debug.lni
+++ b/server/libs/@lua/debug.lni
@@ -59,25 +59,25 @@ name = 'info'
type = 'table'
[[.enums]]
name = 'what'
-enum = 'n'
+enum = '"n"'
``````````
name = 'what'
-enum = 'S'
+enum = '"S"'
``````````
name = 'what'
-enum = 'l'
+enum = '"l"'
``````````
name = 'what'
-enum = 't'
+enum = '"t"'
``````````
name = 'what'
-enum = 'u'
+enum = '"u"'
``````````
name = 'what'
-enum = 'f'
+enum = '"f"'
``````````
name = 'what'
-enum = 'L'
+enum = '"L"'
['getinfo Lua 5.1':getinfo]
name = 'getinfo'
@@ -177,13 +177,13 @@ type = 'integer'
optional = 'self'
[[.enums]]
name = 'mask'
-enum = 'c'
+enum = '"c"'
``````````
name = 'mask'
-enum = 'r'
+enum = '"r"'
``````````
name = 'mask'
-enum = 'l'
+enum = '"l"'
[setlocal]
[[.args]]
diff --git a/server/libs/@lua/file.lni b/server/libs/@lua/file.lni
index f75a02ab..387a10df 100644
--- a/server/libs/@lua/file.lni
+++ b/server/libs/@lua/file.lni
@@ -22,10 +22,10 @@ type = 'string'
name = 'code'
[[.enums]]
name = 'type'
-enum = 'exit'
+enum = '"exit"'
``````````
name = 'type'
-enum = 'signal'
+enum = '"signal"'
[flush]
[[.args]]
@@ -47,17 +47,17 @@ returns = {
}
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
default = true
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
``````````
name = 'mode'
code = 'number'
@@ -74,17 +74,17 @@ type = {'string', 'number'}
type = '...'
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
default = true
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
``````````
name = 'mode'
code = 'number'
@@ -110,14 +110,14 @@ type = 'string'
optional = 'self'
[[.enums]]
name = 'whence'
-enum = 'set'
+enum = '"set"'
``````````
name = 'whence'
-enum = 'cur'
+enum = '"cur"'
default = true
``````````
name = 'whence'
-enum = 'end'
+enum = '"end"'
[setvbuf]
[[.args]]
@@ -130,13 +130,13 @@ name = 'size'
type = 'integer'
[[.enums]]
name = 'mode'
-enum = 'no'
+enum = '"no"'
``````````
name = 'mode'
-enum = 'full'
+enum = '"full"'
``````````
name = 'mode'
-enum = 'line'
+enum = '"line"'
[write]
[[.args]]
diff --git a/server/libs/@lua/io.lni b/server/libs/@lua/io.lni
index 69765784..00e8c9c8 100644
--- a/server/libs/@lua/io.lni
+++ b/server/libs/@lua/io.lni
@@ -45,10 +45,10 @@ type = 'string'
name = 'code'
[[.enums]]
name = 'type'
-enum = 'exit'
+enum = '"exit"'
``````````
name = 'type'
-enum = 'signal'
+enum = '"signal"'
[flush]
@@ -81,13 +81,13 @@ returns = {
}
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
default = true
``````````
name = 'mode'
@@ -113,17 +113,17 @@ returns = {
}
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
default = true
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
``````````
name = 'mode'
code = 'number'
@@ -148,17 +148,17 @@ returns = {
}
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
default = true
``````````
name = 'mode'
-enum = '*L'
+enum = '"*L"'
``````````
name = 'mode'
code = 'number'
@@ -176,23 +176,23 @@ default = 'r'
type = 'FILE*'
[[.enums]]
name = 'mode'
-enum = 'r'
+enum = '"r"'
default = true
``````````
name = 'mode'
-enum = 'w'
+enum = '"w"'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
``````````
name = 'mode'
-enum = 'r+'
+enum = '"r+"'
``````````
name = 'mode'
-enum = 'w+'
+enum = '"w+"'
``````````
name = 'mode'
-enum = 'a+'
+enum = '"a+"'
[output:input]
@@ -210,11 +210,11 @@ name = 'file'
type = 'FILE*'
[[.enums]]
name = 'mode'
-enum = 'r'
+enum = '"r"'
default = true
``````````
name = 'mode'
-enum = 'w'
+enum = '"w"'
["read Lua 5.1"]
name = 'read'
@@ -228,13 +228,13 @@ type = {'string', 'number'}
type = '...'
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
default = true
``````````
name = 'mode'
@@ -252,17 +252,17 @@ type = {'string', 'number'}
type = '...'
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
default = true
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
``````````
name = 'mode'
code = 'number'
@@ -279,17 +279,17 @@ type = {'string', 'number'}
type = '...'
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
default = true
``````````
name = 'mode'
-enum = '*L'
+enum = '"*L"'
``````````
name = 'mode'
code = 'number'
@@ -307,10 +307,10 @@ name = 'type'
type = 'string'
[[.enums]]
name = 'type'
-enum = 'file'
+enum = '"file"'
``````````
name = 'type'
-enum = 'closed file'
+enum = '"closed file"'
``````````
name = 'type'
code = 'nil'
diff --git a/server/libs/@lua/math.lni b/server/libs/@lua/math.lni
index 52a03d6b..aef488e1 100644
--- a/server/libs/@lua/math.lni
+++ b/server/libs/@lua/math.lni
@@ -321,10 +321,10 @@ name = 'type'
type = 'string'
[[.enums]]
name = 'type'
-enum = 'integer'
+enum = '"integer"'
``````````
name = 'type'
-enum = 'float'
+enum = '"float"'
``````````
name = 'type'
code = 'nil'
diff --git a/server/libs/@lua/os.lni b/server/libs/@lua/os.lni
index f986a826..f6b69317 100644
--- a/server/libs/@lua/os.lni
+++ b/server/libs/@lua/os.lni
@@ -63,10 +63,10 @@ name = 'code'
type = 'integer'
[[.enums]]
type = 'type'
-enum = 'exit'
+enum = '"exit"'
``````````
type = 'type'
-enum = 'signal'
+enum = '"signal"'
['execute Lua 5.1']
name = 'execute'
@@ -146,23 +146,23 @@ name = 'locale'
type = 'string'
[[.enums]]
name = 'category'
-enum = 'all'
+enum = '"all"'
default = true
``````````
name = 'category'
-enum = 'collate'
+enum = '"collate"'
``````````
name = 'category'
-enum = 'ctype'
+enum = '"ctype"'
``````````
name = 'category'
-enum = 'monetary'
+enum = '"monetary"'
``````````
name = 'category'
-enum = 'numeric'
+enum = '"numeric"'
``````````
name = 'category'
-enum = 'time'
+enum = '"time"'
[time]
[[.args]]
diff --git a/server/locale/en-US/libs/@lua/basic.lni b/server/locale/en-US/libs/@lua/basic.lni
index f69128f9..ccd1f05d 100644
--- a/server/locale/en-US/libs/@lua/basic.lni
+++ b/server/locale/en-US/libs/@lua/basic.lni
@@ -7,77 +7,77 @@ description = 'Calls error if the value of its argument is false.'
[collectgarbage]
[[.enums]]
name = 'opt'
-enum = 'collect'
+enum = '"collect"'
description = 'Performs a full garbage-collection cycle.'
``````````
name = 'opt'
-enum = 'stop'
+enum = '"stop"'
description = 'Stops automatic execution.'
``````````
name = 'opt'
-enum = 'restart'
+enum = '"restart"'
description = 'Restarts automatic execution.'
``````````
name = 'opt'
-enum = 'count'
+enum = '"count"'
description = 'Returns the total memory in Kbytes.'
``````````
name = 'opt'
-enum = 'step'
+enum = '"step"'
description = 'Performs a garbage-collection step.'
``````````
name = 'opt'
-enum = 'setpause'
+enum = '"setpause"'
description = 'Set pause.'
``````````
name = 'opt'
-enum = 'setstepmul'
+enum = '"setstepmul"'
description = 'Set step multiplier.'
``````````
name = 'opt'
-enum = 'isrunning'
+enum = '"isrunning"'
description = 'Returns whether the collector is running.'
["collectgarbage Lua 5.4"]
[[.enums]]
name = 'opt'
-enum = 'collect'
+enum = '"collect"'
description = 'Performs a full garbage-collection cycle.'
``````````
name = 'opt'
-enum = 'stop'
+enum = '"stop"'
description = 'Stops automatic execution.'
``````````
name = 'opt'
-enum = 'restart'
+enum = '"restart"'
description = 'Restarts automatic execution.'
``````````
name = 'opt'
-enum = 'count'
+enum = '"count"'
description = 'Returns the total memory in Kbytes.'
``````````
name = 'opt'
-enum = 'step'
+enum = '"step"'
description = 'Performs a garbage-collection step.'
``````````
name = 'opt'
-enum = 'setpause'
+enum = '"setpause"'
description = 'Set pause.'
``````````
name = 'opt'
-enum = 'setstepmul'
+enum = '"setstepmul"'
description = 'Set step multiplier.'
``````````
name = 'opt'
-enum = 'incremental'
+enum = '"incremental"'
description = 'Change the collector mode to incremental.'
``````````
name = 'opt'
-enum = 'generational'
+enum = '"generational"'
description = 'Change the collector mode to generational.'
``````````
name = 'opt'
-enum = 'isrunning'
+enum = '"isrunning"'
description = 'Returns whether the collector is running.'
[dofile]
@@ -109,15 +109,15 @@ end
description = 'Loads a chunk.'
[[.enums]]
name = 'mode'
-enum = 'b'
+enum = '"b"'
description = 'Only binary chunks.'
``````````
name = 'mode'
-enum = 't'
+enum = '"t"'
description = 'Only text chunks.'
``````````
name = 'mode'
-enum = 'bt'
+enum = '"bt"'
description = 'Both binary and text.'
['load Lua 5.1']
@@ -127,15 +127,15 @@ description = 'Loads a chunk using function `func` to get its pieces. Each call
description = 'Loads a chunk from file.'
[[.enums]]
name = 'mode'
-enum = 'b'
+enum = '"b"'
description = 'Only binary chunks.'
``````````
name = 'mode'
-enum = 't'
+enum = '"t"'
description = 'Only text chunks.'
``````````
name = 'mode'
-enum = 'bt'
+enum = '"bt"'
description = 'Both binary and text.'
['loadfile Lua 5.1']
@@ -181,7 +181,7 @@ description = 'Sets the real value of `table[index]` to `value`, without invokin
[select]
[[.enums]]
name = 'index'
-enum = '#'
+enum = '"#"'
description = 'Returns the total number of extra arguments.'
``````````
name = 'index'
diff --git a/server/locale/en-US/libs/@lua/coroutine.lni b/server/locale/en-US/libs/@lua/coroutine.lni
index ed365fe4..e5245206 100644
--- a/server/locale/en-US/libs/@lua/coroutine.lni
+++ b/server/locale/en-US/libs/@lua/coroutine.lni
@@ -20,19 +20,19 @@ description = 'Returns the running coroutine plus a boolean, true when the runni
description = 'Returns the status of coroutine `co`.'
[[.enums]]
name = 'status'
-enum = 'running'
+enum = '"running"'
description = 'Is running.'
``````````
name = 'status'
-enum = 'suspended'
+enum = '"suspended"'
description = 'Is suspended or not started.'
``````````
name = 'status'
-enum = 'normal'
+enum = '"normal"'
description = 'Is active but not running.'
``````````
name = 'status'
-enum = 'dead'
+enum = '"dead"'
description = 'Has finished or stopped with an error.'
[wrap]
diff --git a/server/locale/en-US/libs/@lua/debug.lni b/server/locale/en-US/libs/@lua/debug.lni
index 4c7bd016..8ab9d4f1 100644
--- a/server/locale/en-US/libs/@lua/debug.lni
+++ b/server/locale/en-US/libs/@lua/debug.lni
@@ -11,62 +11,62 @@ description = 'Returns the current hook settings of the thread.'
description = 'Returns a table with information about a function.'
[[.enums]]
name = 'what'
-enum = 'n'
+enum = '"n"'
description = '`name` and `namewhat`'
``````````
name = 'what'
-enum = 'S'
+enum = '"S"'
description = '`source`, `short_src`, `linedefined`, `lastlinedefined`, and `what`'
``````````
name = 'what'
-enum = 'l'
+enum = '"l"'
description = '`currentline`'
``````````
name = 'what'
-enum = 't'
+enum = '"t"'
description = '`istailcall`'
``````````
name = 'what'
-enum = 'u'
+enum = '"u"'
description = '`nups`, `nparams`, and `isvararg`'
``````````
name = 'what'
-enum = 'f'
+enum = '"f"'
description = '`func`'
``````````
name = 'what'
-enum = 'L'
+enum = '"L"'
description = '`activelines`'
['getinfo Lua 5.1']
description = 'Returns a table with information about a function.'
[[.enums]]
name = 'what'
-enum = 'n'
+enum = '"n"'
description = '`name` and `namewhat`'
``````````
name = 'what'
-enum = 'S'
+enum = '"S"'
description = '`source`, `short_src`, `linedefined`, `lastlinedefined`, and `what`'
``````````
name = 'what'
-enum = 'l'
+enum = '"l"'
description = '`currentline`'
``````````
name = 'what'
-enum = 't'
+enum = '"t"'
description = '`istailcall`'
``````````
name = 'what'
-enum = 'u'
+enum = '"u"'
description = '`nups`'
``````````
name = 'what'
-enum = 'f'
+enum = '"f"'
description = '`func`'
``````````
name = 'what'
-enum = 'L'
+enum = '"L"'
description = '`activelines`'
[getlocal]
@@ -101,15 +101,15 @@ description = 'Sets the environment of the given `object` to the given `table` .
description = 'Sets the given function as a hook.'
[[.enums]]
name = 'mask'
-enum = 'c'
+enum = '"c"'
description = 'Calls hook when Lua calls a function.'
``````````
name = 'mask'
-enum = 'r'
+enum = '"r"'
description = 'Calls hook when Lua returns from a function.'
``````````
name = 'mask'
-enum = 'l'
+enum = '"l"'
description = 'Calls hook when Lua enters a new line of code.'
[setlocal]
diff --git a/server/locale/en-US/libs/@lua/file.lni b/server/locale/en-US/libs/@lua/file.lni
index 4200b65f..58bb2278 100644
--- a/server/locale/en-US/libs/@lua/file.lni
+++ b/server/locale/en-US/libs/@lua/file.lni
@@ -15,19 +15,19 @@ end
]]
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = 'Reads the next line keeping the end of line.'
``````````
name = 'mode'
@@ -38,19 +38,19 @@ description = 'Reads a string with up to this number of bytes.'
description = 'Reads the `file`, according to the given formats, which specify what to read.'
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = 'Reads the next line keeping the end of line.'
``````````
name = 'mode'
@@ -61,30 +61,30 @@ description = 'Reads a string with up to this number of bytes.'
description = 'Sets and gets the file position, measured from the beginning of the file.'
[[.enums]]
name = 'whence'
-enum = 'set'
+enum = '"set"'
description = 'Base is beginning of the file.'
``````````
name = 'whence'
-enum = 'cur'
+enum = '"cur"'
description = 'Base is current position.'
``````````
name = 'whence'
-enum = 'end'
+enum = '"end"'
description = 'Base is end of file.'
[setvbuf]
description = 'Sets the buffering mode for an output file.'
[[.enums]]
name = 'mode'
-enum = 'no'
+enum = '"no"'
description = 'Output operation appears immediately.'
``````````
name = 'mode'
-enum = 'full'
+enum = '"full"'
description = 'Performed only when the buffer is full.'
``````````
name = 'mode'
-enum = 'line'
+enum = '"line"'
description = 'Buffered until a newline is output.'
[write]
diff --git a/server/locale/en-US/libs/@lua/io.lni b/server/locale/en-US/libs/@lua/io.lni
index 68cf8830..2b405f2f 100644
--- a/server/locale/en-US/libs/@lua/io.lni
+++ b/server/locale/en-US/libs/@lua/io.lni
@@ -27,15 +27,15 @@ end
]]
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
@@ -53,19 +53,19 @@ end
]]
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = 'Reads the next line keeping the end of line.'
``````````
name = 'mode'
@@ -83,19 +83,19 @@ end
]]
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
-enum = '*L'
+enum = '"*L"'
description = 'Reads the next line keeping the end of line.'
``````````
name = 'mode'
@@ -106,27 +106,27 @@ description = 'Reads a string with up to this number of bytes.'
description = 'Opens a file, in the mode specified in the string `mode`.'
[[.enums]]
name = 'mode'
-enum = 'r'
+enum = '"r"'
description = 'Read mode.'
``````````
name = 'mode'
-enum = 'w'
+enum = '"w"'
description = 'Write mode.'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = 'Append mode.'
``````````
name = 'mode'
-enum = 'r+'
+enum = '"r+"'
description = 'Update mode, all previous data is preserved.'
``````````
name = 'mode'
-enum = 'w+'
+enum = '"w+"'
description = 'Update mode, all previous data is erased.'
``````````
name = 'mode'
-enum = 'a+'
+enum = '"a+"'
description = 'Append update mode, previous data is preserved, writing is only allowed at the end of file.'
[output]
@@ -136,26 +136,26 @@ description = 'Sets `file` as the default output file.'
description = 'Starts program prog in a separated process.'
[[.enums]]
name = 'mode'
-enum = 'r'
+enum = '"r"'
description = 'Read data from this program by `file`.'
``````````
name = 'mode'
-enum = 'w'
+enum = '"w"'
description = 'Write data to this program by `file`.'
["read Lua 5.1"]
description = 'Reads the `file`, according to the given formats, which specify what to read.'
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
@@ -166,19 +166,19 @@ description = 'Reads a string with up to this number of bytes.'
description = 'Reads the `file`, according to the given formats, which specify what to read.'
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = 'Reads the next line keeping the end of line.'
``````````
name = 'mode'
@@ -189,19 +189,19 @@ description = 'Reads a string with up to this number of bytes.'
description = 'Reads the `file`, according to the given formats, which specify what to read.'
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = 'Reads a numeral and returns it as number.'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = 'Reads the whole file.'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = 'Reads the next line skipping the end of line.'
``````````
name = 'mode'
-enum = '*L'
+enum = '"*L"'
description = 'Reads the next line keeping the end of line.'
``````````
name = 'mode'
@@ -215,11 +215,11 @@ description = 'In case of success, returns a handle for a temporary file.'
description = 'Checks whether `obj` is a valid file handle.'
[[.enums]]
name = 'type'
-enum = 'file'
+enum = '"file"'
description = 'Is an open file handle.'
``````````
name = 'type'
-enum = 'closed file'
+enum = '"closed file"'
description = 'Is a closed file handle.'
``````````
name = 'type'
diff --git a/server/locale/en-US/libs/@lua/math.lni b/server/locale/en-US/libs/@lua/math.lni
index 52645cee..034153e7 100644
--- a/server/locale/en-US/libs/@lua/math.lni
+++ b/server/locale/en-US/libs/@lua/math.lni
@@ -117,11 +117,11 @@ description = 'If the value `x` is convertible to an integer, returns that integ
[type]
[[.enums]]
name = 'type'
-enum = 'integer'
+enum = '"integer"'
description = '`x` is an integer.'
``````````
name = 'type'
-enum = 'float'
+enum = '"float"'
description = '`x` is a float.'
``````````
name = 'type'
diff --git a/server/locale/zh-CN/libs/@lua/basic.lni b/server/locale/zh-CN/libs/@lua/basic.lni
index 3dcd7802..9415f3e8 100644
--- a/server/locale/zh-CN/libs/@lua/basic.lni
+++ b/server/locale/zh-CN/libs/@lua/basic.lni
@@ -7,77 +7,77 @@ description = '如果其参数 `v` 的值为假,它就调用 `error`。'
[collectgarbage]
[[.enums]]
name = 'opt'
-enum = 'collect'
+enum = '"collect"'
description = '做一次完整的垃圾收集循环。'
``````````
name = 'opt'
-enum = 'stop'
+enum = '"stop"'
description = '停止垃圾收集器的运行。'
``````````
name = 'opt'
-enum = 'restart'
+enum = '"restart"'
description = '重启垃圾收集器的自动运行。'
``````````
name = 'opt'
-enum = 'count'
+enum = '"count"'
description = '以 K 字节数为单位返回 Lua 使用的总内存数。'
``````````
name = 'opt'
-enum = 'step'
+enum = '"step"'
description = '单步运行垃圾收集器。'
``````````
name = 'opt'
-enum = 'setpause'
+enum = '"setpause"'
description = '设置收集器的 `间歇率`。'
``````````
name = 'opt'
-enum = 'setstepmul'
+enum = '"setstepmul"'
description = '设置收集器的 `步进倍率`。'
``````````
name = 'opt'
-enum = 'isrunning'
+enum = '"isrunning"'
description = '返回表示收集器是否在工作的布尔值。'
["collectgarbage Lua 5.4"]
[[.enums]]
name = 'opt'
-enum = 'collect'
+enum = '"collect"'
description = '做一次完整的垃圾收集循环。'
``````````
name = 'opt'
-enum = 'stop'
+enum = '"stop"'
description = '停止垃圾收集器的运行。'
``````````
name = 'opt'
-enum = 'restart'
+enum = '"restart"'
description = '重启垃圾收集器的自动运行。'
``````````
name = 'opt'
-enum = 'count'
+enum = '"count"'
description = '以 K 字节数为单位返回 Lua 使用的总内存数。'
``````````
name = 'opt'
-enum = 'step'
+enum = '"step"'
description = '单步运行垃圾收集器。'
``````````
name = 'opt'
-enum = 'setpause'
+enum = '"setpause"'
description = '设置收集器的 `间歇率`。'
``````````
name = 'opt'
-enum = 'setstepmul'
+enum = '"setstepmul"'
description = '设置收集器的 `步进倍率`。'
``````````
name = 'opt'
-enum = 'incremental'
+enum = '"incremental"'
description = '改变收集器模式为增量模式。'
``````````
name = 'opt'
-enum = 'generational'
+enum = '"generational"'
description = '改变收集器模式为分代模式。'
``````````
name = 'opt'
-enum = 'isrunning'
+enum = '"isrunning"'
description = '返回表示收集器是否在工作的布尔值。'
[dofile]
@@ -109,15 +109,15 @@ end
description = '加载一个代码块。'
[[.enums]]
name = 'mode'
-enum = 'b'
+enum = '"b"'
description = '只能是二进制代码块。'
``````````
name = 'mode'
-enum = 't'
+enum = '"t"'
description = '只能是文本代码块。'
``````````
name = 'mode'
-enum = 'bt'
+enum = '"bt"'
description = '可以是二进制也可以是文本。'
['load Lua 5.1']
@@ -127,15 +127,15 @@ description = '使用 `func` 分段加载代码块。每次调用 `func` 必须
description = '从文件中获取代码块。'
[[.enums]]
name = 'mode'
-enum = 'b'
+enum = '"b"'
description = '只能是二进制代码块。'
``````````
name = 'mode'
-enum = 't'
+enum = '"t"'
description = '只能是文本代码块。'
``````````
name = 'mode'
-enum = 'bt'
+enum = '"bt"'
description = '可以是二进制也可以是文本。'
['loadfile Lua 5.1']
@@ -181,7 +181,7 @@ description = '在不触发任何元方法的情况下 将 `table[index]` 设为
[select]
[[.enums]]
name = 'index'
-enum = '#'
+enum = '"#"'
description = '返回参数的个数。'
``````````
name = 'index'
diff --git a/server/locale/zh-CN/libs/@lua/coroutine.lni b/server/locale/zh-CN/libs/@lua/coroutine.lni
index f3d05ea1..9f69018c 100644
--- a/server/locale/zh-CN/libs/@lua/coroutine.lni
+++ b/server/locale/zh-CN/libs/@lua/coroutine.lni
@@ -20,19 +20,19 @@ description = '返回当前正在运行的协程加一个布尔量。 如果当
description = '以字符串形式返回协程 `co` 的状态。'
[[.enums]]
name = 'status'
-enum = 'running'
+enum = '"running"'
description = '正在运行。'
``````````
name = 'status'
-enum = 'suspended'
+enum = '"suspended"'
description = '挂起或是还没有开始运行。'
``````````
name = 'status'
-enum = 'normal'
+enum = '"normal"'
description = '是活动的,但并不在运行。'
``````````
name = 'status'
-enum = 'dead'
+enum = '"dead"'
description = '运行完主体函数或因错误停止。'
[wrap]
diff --git a/server/locale/zh-CN/libs/@lua/debug.lni b/server/locale/zh-CN/libs/@lua/debug.lni
index 8783b8e3..0725ef24 100644
--- a/server/locale/zh-CN/libs/@lua/debug.lni
+++ b/server/locale/zh-CN/libs/@lua/debug.lni
@@ -11,62 +11,62 @@ description = '返回三个表示线程钩子设置的值: 当前钩子函数
description = '返回关于一个函数信息的表。'
[[.enums]]
name = 'what'
-enum = 'n'
+enum = '"n"'
description = '`name` 和 `namewhat`'
``````````
name = 'what'
-enum = 'S'
+enum = '"S"'
description = '`source`,`short_src`,`linedefined`,`lastlinedefined`,和 `what`'
``````````
name = 'what'
-enum = 'l'
+enum = '"l"'
description = '`currentline`'
``````````
name = 'what'
-enum = 't'
+enum = '"t"'
description = '`istailcall`'
``````````
name = 'what'
-enum = 'u'
+enum = '"u"'
description = '`nups`,`nparams`,和`isvararg`'
``````````
name = 'what'
-enum = 'f'
+enum = '"f"'
description = '`func`'
``````````
name = 'what'
-enum = 'L'
+enum = '"L"'
description = '`activelines`'
['getinfo Lua 5.1']
description = '返回关于一个函数信息的表。'
[[.enums]]
name = 'what'
-enum = 'n'
+enum = '"n"'
description = '`name` 和 `namewhat`'
``````````
name = 'what'
-enum = 'S'
+enum = '"S"'
description = '`source`,`short_src`,`linedefined`,`lastlinedefined`,和 `what`'
``````````
name = 'what'
-enum = 'l'
+enum = '"l"'
description = '`currentline`'
``````````
name = 'what'
-enum = 't'
+enum = '"t"'
description = '`istailcall`'
``````````
name = 'what'
-enum = 'u'
+enum = '"u"'
description = '`nups`'
``````````
name = 'what'
-enum = 'f'
+enum = '"f"'
description = '`func`'
``````````
name = 'what'
-enum = 'L'
+enum = '"L"'
description = '`activelines`'
[getlocal]
@@ -97,15 +97,15 @@ description = '将 `table` 设置为 `object` 的环境。'
description = '将一个函数作为钩子函数设入。'
[[.enums]]
name = 'mask'
-enum = 'c'
+enum = '"c"'
description = '每当 Lua 调用一个函数时,调用钩子。'
``````````
name = 'mask'
-enum = 'r'
+enum = '"r"'
description = '每当 Lua 从一个函数内返回时,调用钩子。'
``````````
name = 'mask'
-enum = 'l'
+enum = '"l"'
description = '每当 Lua 进入新的一行时,调用钩子。'
[setlocal]
diff --git a/server/locale/zh-CN/libs/@lua/file.lni b/server/locale/zh-CN/libs/@lua/file.lni
index 73dfd67d..4dcace0f 100644
--- a/server/locale/zh-CN/libs/@lua/file.lni
+++ b/server/locale/zh-CN/libs/@lua/file.lni
@@ -15,19 +15,19 @@ end
]]
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
@@ -38,19 +38,19 @@ description = '读取一个不超过这个数量字节数的字符串。'
description = '读文件 `file`, 指定的格式决定了要读什么。'
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
@@ -61,30 +61,30 @@ description = '读取一个不超过这个数量字节数的字符串。'
description = '设置及获取基于文件开头处计算出的位置。'
[[.enums]]
name = 'whence'
-enum = 'set'
+enum = '"set"'
description = '基点为 0 (文件开头)。'
``````````
name = 'whence'
-enum = 'cur'
+enum = '"cur"'
description = '基点为当前位置。'
``````````
name = 'whence'
-enum = 'end'
+enum = '"end"'
description = '基点为文件尾。'
[setvbuf]
description = '设置输出文件的缓冲模式。'
[[.enums]]
name = 'mode'
-enum = 'no'
+enum = '"no"'
description = '不缓冲;输出操作立刻生效。'
``````````
name = 'mode'
-enum = 'full'
+enum = '"full"'
description = '完全缓冲;只有在缓存满或调用 flush 时才做输出操作。'
``````````
name = 'mode'
-enum = 'line'
+enum = '"line"'
description = '行缓冲;输出将缓冲到每次换行前。'
[write]
diff --git a/server/locale/zh-CN/libs/@lua/io.lni b/server/locale/zh-CN/libs/@lua/io.lni
index 8881777f..34f6d5eb 100644
--- a/server/locale/zh-CN/libs/@lua/io.lni
+++ b/server/locale/zh-CN/libs/@lua/io.lni
@@ -27,15 +27,15 @@ end
]]
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
@@ -53,19 +53,19 @@ end
]]
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
@@ -83,19 +83,19 @@ end
]]
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
-enum = '*L'
+enum = '"*L"'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
@@ -106,27 +106,27 @@ description = '读取一个不超过这个数量字节数的字符串。'
description = '用字符串 `mode` 指定的模式打开一个文件。'
[[.enums]]
name = 'mode'
-enum = 'r'
+enum = '"r"'
description = '读模式。'
``````````
name = 'mode'
-enum = 'w'
+enum = '"w"'
description = '写模式。'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = '追加模式。'
``````````
name = 'mode'
-enum = 'r+'
+enum = '"r+"'
description = '更新模式,所有之前的数据都保留。'
``````````
name = 'mode'
-enum = 'w+'
+enum = '"w+"'
description = '更新模式,所有之前的数据都删除。'
``````````
name = 'mode'
-enum = 'a+'
+enum = '"a+"'
description = '追加更新模式,所有之前的数据都保留,只允许在文件尾部做写入。'
[output]
@@ -136,26 +136,26 @@ description = '设置 `file` 为默认输出文件。'
description = '用一个分离进程开启程序 `prog` 。'
[[.enums]]
name = 'mode'
-enum = 'r'
+enum = '"r"'
description = '从这个程序中读取数据。'
``````````
name = 'mode'
-enum = 'w'
+enum = '"w"'
description = '向这个程序写入输入。'
["read Lua 5.1"]
description = '读文件 `file`, 指定的格式决定了要读什么。'
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
@@ -166,19 +166,19 @@ description = '读取一个不超过这个数量字节数的字符串。'
description = '读文件 `file`, 指定的格式决定了要读什么。'
[[.enums]]
name = 'mode'
-enum = 'n'
+enum = '"n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = 'a'
+enum = '"a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = 'l'
+enum = '"l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
-enum = 'L'
+enum = '"L"'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
@@ -189,19 +189,19 @@ description = '读取一个不超过这个数量字节数的字符串。'
description = '读文件 `file`, 指定的格式决定了要读什么。'
[[.enums]]
name = 'mode'
-enum = '*n'
+enum = '"*n"'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
-enum = '*a'
+enum = '"*a"'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
-enum = '*l'
+enum = '"*l"'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
-enum = '*L'
+enum = '"*L"'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
@@ -215,11 +215,11 @@ description = '如果成功,返回一个临时文件的句柄。'
description = '检查 `obj` 是否是合法的文件句柄。'
[[.enums]]
name = 'type'
-enum = 'file'
+enum = '"file"'
description = '是一个打开的文件句柄。'
``````````
name = 'type'
-enum = 'closed file'
+enum = '"closed file"'
description = '是一个关闭的文件句柄。'
``````````
name = 'type'
diff --git a/server/locale/zh-CN/libs/@lua/math.lni b/server/locale/zh-CN/libs/@lua/math.lni
index c89ca616..fba72360 100644
--- a/server/locale/zh-CN/libs/@lua/math.lni
+++ b/server/locale/zh-CN/libs/@lua/math.lni
@@ -117,11 +117,11 @@ description = '如果 `x` 可以转换为一个整数, 返回该整数。'
[type]
[[.enums]]
name = 'type'
-enum = 'integer'
+enum = '"integer"'
description = '`x` 是一个整数。'
``````````
name = 'type'
-enum = 'float'
+enum = '"float"'
description = '`x` 是一个浮点数。'
``````````
name = 'type'
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index 8f481b4f..502d08fa 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -519,16 +519,29 @@ local function searchSource(vm, source, word, callback, pos)
end
local function buildTextEdit(start, finish, str, quo)
- local text, lquo, rquo
+ local text, lquo, rquo, label, filterText
if quo == '"' then
+ label = str
+ filterText = str
text = str:gsub('\r', '\\r'):gsub('\n', '\\n'):gsub('"', '\\"')
lquo = quo
rquo = quo
elseif quo == "'" then
+ label = str
+ filterText = str
text = str:gsub('\r', '\\r'):gsub('\n', '\\n'):gsub("'", "\\'")
lquo = quo
rquo = quo
+ elseif quo == nil then
+ quo = ''
+ text = str:gsub('\r', '\\r'):gsub('\n', '\\n'):gsub('"', '\\"')
+ lquo = quo
+ rquo = quo
+ label = '"' .. text .. '"'
+ filterText = label
else
+ label = str
+ filterText = str
lquo = quo
rquo = ']' .. lquo:sub(2, -2) .. ']'
while str:find(rquo, 1, true) do
@@ -538,8 +551,8 @@ local function buildTextEdit(start, finish, str, quo)
text = str
end
return {
- label = str,
- filterText = str,
+ label = label,
+ filterText = filterText,
textEdit = {
start = start + #quo,
finish = finish - #quo,
@@ -597,22 +610,18 @@ local function searchEnumAsLib(vm, source, word, callback, pos, args, lib)
for _, enum in ipairs(lib.enums) do
if enum.name and enum.name == name and enum.enum then
if matchKey(word, enum.enum) then
- local label, textEdit
- if source.type ~= (arg and arg.type) then
- label = ('%q'):format(enum.enum)
- end
- if source.type ~= 'call' then
- textEdit = {
- start = source.start,
- finish = source.finish,
- newText = ('%q'):format(enum.enum),
- }
+ local strSource = parser:ast(tostring(enum.enum), 'String')
+ if strSource then
+ if source.type == 'string' then
+ local data = buildTextEdit(source.start, source.finish, strSource[1], source[2])
+ data.documentation = enum.description
+ callback(enum.enum, nil, CompletionItemKind.EnumMember, data)
+ else
+ local data = buildTextEdit(source.start, source.finish, strSource[1], nil)
+ data.documentation = enum.description
+ callback(enum.enum, nil, CompletionItemKind.EnumMember, data)
+ end
end
- callback(enum.enum, nil, CompletionItemKind.EnumMember, {
- label = label,
- documentation = enum.description,
- textEdit = textEdit,
- })
end
end
end
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 5450fcf6..918195da 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -379,83 +379,67 @@ collectgarbage('$')
{
{
label = 'collect',
+ filterText = 'collect',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"collect"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'stop',
+ filterText = 'stop',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"stop"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'restart',
+ filterText = 'restart',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"restart"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'count',
+ filterText = 'count',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"count"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'step',
+ filterText = 'step',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"step"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'setpause',
+ filterText = 'setpause',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"setpause"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'setstepmul',
+ filterText = 'setstepmul',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"setstepmul"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = 'isrunning',
+ filterText = 'isrunning',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = {
- start = 16,
- finish = 17,
- newText = '"isrunning"',
- },
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
}
@@ -472,21 +456,29 @@ io.read($)
label = '"n"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = '"a"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = '"l"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
{
label = '"L"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
+ textEdit = EXISTS,
+ additionalTextEdits = EXISTS,
},
}