This commit is contained in:
2025-11-18 15:15:04 -05:00
parent 81a6c323d6
commit 488bbd20d2
1641 changed files with 927512 additions and 14 deletions

View File

@@ -0,0 +1,783 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
'Command-line arguments of Lua Standalone.'
assert =
'Raises an error if the value of its argument v is false (i.e., `nil` or `false`); otherwise, returns all its arguments. In case of error, `message` is the error object; when absent, it defaults to `"assertion failed!"`'
cgopt.collect =
'Performs a full garbage-collection cycle.'
cgopt.stop =
'Stops automatic execution.'
cgopt.restart =
'Restarts automatic execution.'
cgopt.count =
'Returns the total memory in Kbytes.'
cgopt.step =
'Performs a garbage-collection step.'
cgopt.setpause =
'Set `pause`.'
cgopt.setstepmul =
'Set `step multiplier`.'
cgopt.incremental =
'Change the collector mode to incremental.'
cgopt.generational =
'Change the collector mode to generational.'
cgopt.isrunning =
'Returns whether the collector is running.'
collectgarbage =
'This function is a generic interface to the garbage collector. It performs different functions according to its first argument, `opt`.'
dofile =
'Opens the named file and executes its content as a Lua chunk. When called without arguments, `dofile` executes the content of the standard input (`stdin`). Returns all values returned by the chunk. In case of errors, `dofile` propagates the error to its caller. (That is, `dofile` does not run in protected mode.)'
error =
[[
Terminates the last protected function called and returns message as the error object.
Usually, `error` adds some information about the error position at the beginning of the message, if the message is a string.
]]
_G =
'A global variable (not a function) that holds the global environment (see §2.2). Lua itself does not use this variable; changing its value does not affect any environment, nor vice versa.'
getfenv =
'Returns the current environment in use by the function. `f` can be a Lua function or a number that specifies the function at that stack level.'
getmetatable =
'If object does not have a metatable, returns nil. Otherwise, if the object\'s metatable has a __metatable field, returns the associated value. Otherwise, returns the metatable of the given object.'
ipairs =
[[
Returns three values (an iterator function, the table `t`, and `0`) so that the construction
```lua
for i,v in ipairs(t) do body end
```
will iterate over the keyvalue pairs `(1,t[1]), (2,t[2]), ...`, up to the first absent index.
]]
loadmode.b =
'Only binary chunks.'
loadmode.t =
'Only text chunks.'
loadmode.bt =
'Both binary and text.'
load['<5.1'] =
'Loads a chunk using function `func` to get its pieces. Each call to `func` must return a string that concatenates with previous results.'
load['>5.2'] =
[[
Loads a chunk.
If `chunk` is a string, the chunk is this string. If `chunk` is a function, `load` calls it repeatedly to get the chunk pieces. Each call to `chunk` must return a string that concatenates with previous results. A return of an empty string, `nil`, or no value signals the end of the chunk.
]]
loadfile =
'Loads a chunk from file `filename` or from the standard input, if no file name is given.'
loadstring =
'Loads a chunk from the given string.'
module =
'Creates a module.'
next =
[[
Allows a program to traverse all fields of a table. Its first argument is a table and its second argument is an index in this table. A call to `next` returns the next index of the table and its associated value. When called with `nil` as its second argument, `next` returns an initial index and its associated value. When called with the last index, or with `nil` in an empty table, `next` returns `nil`. If the second argument is absent, then it is interpreted as `nil`. In particular, you can use `next(t)` to check whether a table is empty.
The order in which the indices are enumerated is not specified, *even for numeric indices*. (To traverse a table in numerical order, use a numerical `for`.)
The behavior of `next` is undefined if, during the traversal, you assign any value to a non-existent field in the table. You may however modify existing fields. In particular, you may set existing fields to nil.
]]
pairs =
[[
If `t` has a metamethod `__pairs`, calls it with t as argument and returns the first three results from the call.
Otherwise, returns three values: the $next function, the table `t`, and `nil`, so that the construction
```lua
for k,v in pairs(t) do body end
```
will iterate over all keyvalue pairs of table `t`.
See function $next for the caveats of modifying the table during its traversal.
]]
pcall =
[[
Calls the function `f` with the given arguments in *protected mode*. This means that any error inside `f` is not propagated; instead, `pcall` catches the error and returns a status code. Its first result is the status code (a boolean), which is true if the call succeeds without errors. In such case, `pcall` also returns all results from the call, after this first result. In case of any error, `pcall` returns `false` plus the error object.
]]
print =
[[
Receives any number of arguments and prints their values to `stdout`, converting each argument to a string following the same rules of $tostring.
The function print is not intended for formatted output, but only as a quick way to show a value, for instance for debugging. For complete control over the output, use $string.format and $io.write.
]]
rawequal =
'Checks whether v1 is equal to v2, without invoking the `__eq` metamethod.'
rawget =
'Gets the real value of `table[index]`, without invoking the `__index` metamethod.'
rawlen =
'Returns the length of the object `v`, without invoking the `__len` metamethod.'
rawset =
[[
Sets the real value of `table[index]` to `value`, without using the `__newindex` metavalue. `table` must be a table, `index` any value different from `nil` and `NaN`, and `value` any Lua value.
This function returns `table`.
]]
select =
'If `index` is a number, returns all arguments after argument number `index`; a negative number indexes from the end (`-1` is the last argument). Otherwise, `index` must be the string `"#"`, and `select` returns the total number of extra arguments it received.'
setfenv =
'Sets the environment to be used by the given function.'
setmetatable =
[[
Sets the metatable for the given table. If `metatable` is `nil`, removes the metatable of the given table. If the original metatable has a `__metatable` field, raises an error.
This function returns `table`.
To change the metatable of other types from Lua code, you must use the debug library (§6.10).
]]
tonumber =
[[
When called with no `base`, `tonumber` tries to convert its argument to a number. If the argument is already a number or a string convertible to a number, then `tonumber` returns this number; otherwise, it returns `fail`.
The conversion of strings can result in integers or floats, according to the lexical conventions of Lua (see §3.1). The string may have leading and trailing spaces and a sign.
]]
tostring =
[[
Receives a value of any type and converts it to a string in a human-readable format.
If the metatable of `v` has a `__tostring` field, then `tostring` calls the corresponding value with `v` as argument, and uses the result of the call as its result. Otherwise, if the metatable of `v` has a `__name` field with a string value, `tostring` may use that string in its final result.
For complete control of how numbers are converted, use $string.format.
]]
type =
[[
Returns the type of its only argument, coded as a string. The possible results of this function are `"nil"` (a string, not the value `nil`), `"number"`, `"string"`, `"boolean"`, `"table"`, `"function"`, `"thread"`, and `"userdata"`.
]]
_VERSION =
'A global variable (not a function) that holds a string containing the running Lua version.'
warn =
'Emits a warning with a message composed by the concatenation of all its arguments (which should be strings).'
xpcall['=5.1'] =
'Calls function `f` with the given arguments in protected mode with a new message handler.'
xpcall['>5.2'] =
'Calls function `f` with the given arguments in protected mode with a new message handler.'
unpack =
[[
Returns the elements from the given `list`. This function is equivalent to
```lua
return list[i], list[i+1], ···, list[j]
```
]]
bit32 =
''
bit32.arshift =
[[
Returns the number `x` shifted `disp` bits to the right. Negative displacements shift to the left.
This shift operation is what is called arithmetic shift. Vacant bits on the left are filled with copies of the higher bit of `x`; vacant bits on the right are filled with zeros.
]]
bit32.band =
'Returns the bitwise *and* of its operands.'
bit32.bnot =
[[
Returns the bitwise negation of `x`.
```lua
assert(bit32.bnot(x) ==
(-1 - x) % 2^32)
```
]]
bit32.bor =
'Returns the bitwise *or* of its operands.'
bit32.btest =
'Returns a boolean signaling whether the bitwise *and* of its operands is different from zero.'
bit32.bxor =
'Returns the bitwise *exclusive or* of its operands.'
bit32.extract =
'Returns the unsigned number formed by the bits `field` to `field + width - 1` from `n`.'
bit32.replace =
'Returns a copy of `n` with the bits `field` to `field + width - 1` replaced by the value `v` .'
bit32.lrotate =
'Returns the number `x` rotated `disp` bits to the left. Negative displacements rotate to the right.'
bit32.lshift =
[[
Returns the number `x` shifted `disp` bits to the left. Negative displacements shift to the right. In any direction, vacant bits are filled with zeros.
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
bit32.rrotate =
'Returns the number `x` rotated `disp` bits to the right. Negative displacements rotate to the left.'
bit32.rshift =
[[
Returns the number `x` shifted `disp` bits to the right. Negative displacements shift to the left. In any direction, vacant bits are filled with zeros.
```lua
assert(bit32.rshift(b, disp) ==
math.floor(b % 2^32 / 2^disp))
```
]]
coroutine =
''
coroutine.create =
'Creates a new coroutine, with body `f`. `f` must be a function. Returns this new coroutine, an object with type `"thread"`.'
coroutine.isyieldable =
'Returns true when the running coroutine can yield.'
coroutine.isyieldable['>5.4']=
'Returns true when the coroutine `co` can yield. The default for `co` is the running coroutine.'
coroutine.close =
'Closes coroutine `co` , closing all its pending to-be-closed variables and putting the coroutine in a dead state.'
coroutine.resume =
'Starts or continues the execution of coroutine `co`.'
coroutine.running =
'Returns the running coroutine plus a boolean, true when the running coroutine is the main one.'
coroutine.status =
'Returns the status of coroutine `co`.'
coroutine.wrap =
'Creates a new coroutine, with body `f`; `f` must be a function. Returns a function that resumes the coroutine each time it is called.'
coroutine.yield =
'Suspends the execution of the calling coroutine.'
costatus.running =
'Is running.'
costatus.suspended =
'Is suspended or not started.'
costatus.normal =
'Is active but not running.'
costatus.dead =
'Has finished or stopped with an error.'
debug =
''
debug.debug =
'Enters an interactive mode with the user, running each string that the user enters.'
debug.getfenv =
'Returns the environment of object `o` .'
debug.gethook =
'Returns the current hook settings of the thread.'
debug.getinfo =
'Returns a table with information about a function.'
debug.getlocal['<5.1'] =
'Returns the name and the value of the local variable with index `local` of the function at level `level` of the stack.'
debug.getlocal['>5.2'] =
'Returns the name and the value of the local variable with index `local` of the function at level `f` of the stack.'
debug.getmetatable =
'Returns the metatable of the given value.'
debug.getregistry =
'Returns the registry table.'
debug.getupvalue =
'Returns the name and the value of the upvalue with index `up` of the function.'
debug.getuservalue['<5.3'] =
'Returns the Lua value associated to u.'
debug.getuservalue['>5.4'] =
[[
Returns the `n`-th user value associated
to the userdata `u` plus a boolean,
`false` if the userdata does not have that value.
]]
debug.setcstacklimit =
[[
### **Deprecated in `Lua 5.4.2`**
Sets a new limit for the C stack. This limit controls how deeply nested calls can go in Lua, with the intent of avoiding a stack overflow.
In case of success, this function returns the old limit. In case of error, it returns `false`.
]]
debug.setfenv =
'Sets the environment of the given `object` to the given `table` .'
debug.sethook =
'Sets the given function as a hook.'
debug.setlocal =
'Assigns the `value` to the local variable with index `local` of the function at `level` of the stack.'
debug.setmetatable =
'Sets the metatable for the given value to the given table (which can be `nil`).'
debug.setupvalue =
'Assigns the `value` to the upvalue with index `up` of the function.'
debug.setuservalue['<5.3'] =
'Sets the given value as the Lua value associated to the given udata.'
debug.setuservalue['>5.4'] =
[[
Sets the given `value` as
the `n`-th user value associated to the given `udata`.
`udata` must be a full userdata.
]]
debug.traceback =
'Returns a string with a traceback of the call stack. The optional message string is appended at the beginning of the traceback.'
debug.upvalueid =
'Returns a unique identifier (as a light userdata) for the upvalue numbered `n` from the given function.'
debug.upvaluejoin =
'Make the `n1`-th upvalue of the Lua closure `f1` refer to the `n2`-th upvalue of the Lua closure `f2`.'
infowhat.n =
'`name` and `namewhat`'
infowhat.S =
'`source`, `short_src`, `linedefined`, `lastlinedefined`, and `what`'
infowhat.l =
'`currentline`'
infowhat.t =
'`istailcall`'
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
'`nups`, `nparams`, and `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
'`ftransfer` and `ntransfer`'
infowhat.L =
'`activelines`'
hookmask.c =
'Calls hook when Lua calls a function.'
hookmask.r =
'Calls hook when Lua returns from a function.'
hookmask.l =
'Calls hook when Lua enters a new line of code.'
file =
''
file[':close'] =
'Close `file`.'
file[':flush'] =
'Saves any written data to `file`.'
file[':lines'] =
[[
------
```lua
for c in file:lines(...) do
body
end
```
]]
file[':read'] =
'Reads the `file`, according to the given formats, which specify what to read.'
file[':seek'] =
'Sets and gets the file position, measured from the beginning of the file.'
file[':setvbuf'] =
'Sets the buffering mode for an output file.'
file[':write'] =
'Writes the value of each of its arguments to `file`.'
readmode.n =
'Reads a numeral and returns it as number.'
readmode.a =
'Reads the whole file.'
readmode.l =
'Reads the next line skipping the end of line.'
readmode.L =
'Reads the next line keeping the end of line.'
seekwhence.set =
'Base is beginning of the file.'
seekwhence.cur =
'Base is current position.'
seekwhence['.end'] =
'Base is end of file.'
vbuf.no =
'Output operation appears immediately.'
vbuf.full =
'Performed only when the buffer is full.'
vbuf.line =
'Buffered until a newline is output.'
io =
''
io.stdin =
'standard input.'
io.stdout =
'standard output.'
io.stderr =
'standard error.'
io.close =
'Close `file` or default output file.'
io.flush =
'Saves any written data to default output file.'
io.input =
'Sets `file` as the default input file.'
io.lines =
[[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
io.open =
'Opens a file, in the mode specified in the string `mode`.'
io.output =
'Sets `file` as the default output file.'
io.popen =
'Starts program prog in a separated process.'
io.read =
'Reads the `file`, according to the given formats, which specify what to read.'
io.tmpfile =
'In case of success, returns a handle for a temporary file.'
io.type =
'Checks whether `obj` is a valid file handle.'
io.write =
'Writes the value of each of its arguments to default output file.'
openmode.r =
'Read mode.'
openmode.w =
'Write mode.'
openmode.a =
'Append mode.'
openmode['.r+'] =
'Update mode, all previous data is preserved.'
openmode['.w+'] =
'Update mode, all previous data is erased.'
openmode['.a+'] =
'Append update mode, previous data is preserved, writing is only allowed at the end of file.'
openmode.rb =
'Read mode. (in binary mode.)'
openmode.wb =
'Write mode. (in binary mode.)'
openmode.ab =
'Append mode. (in binary mode.)'
openmode['.r+b'] =
'Update mode, all previous data is preserved. (in binary mode.)'
openmode['.w+b'] =
'Update mode, all previous data is erased. (in binary mode.)'
openmode['.a+b'] =
'Append update mode, previous data is preserved, writing is only allowed at the end of file. (in binary mode.)'
popenmode.r =
'Read data from this program by `file`.'
popenmode.w =
'Write data to this program by `file`.'
filetype.file =
'Is an open file handle.'
filetype['.closed file'] =
'Is a closed file handle.'
filetype['.nil'] =
'Is not a file handle.'
math =
''
math.abs =
'Returns the absolute value of `x`.'
math.acos =
'Returns the arc cosine of `x` (in radians).'
math.asin =
'Returns the arc sine of `x` (in radians).'
math.atan['<5.2'] =
'Returns the arc tangent of `x` (in radians).'
math.atan['>5.3'] =
'Returns the arc tangent of `y/x` (in radians).'
math.atan2 =
'Returns the arc tangent of `y/x` (in radians).'
math.ceil =
'Returns the smallest integral value larger than or equal to `x`.'
math.cos =
'Returns the cosine of `x` (assumed to be in radians).'
math.cosh =
'Returns the hyperbolic cosine of `x` (assumed to be in radians).'
math.deg =
'Converts the angle `x` from radians to degrees.'
math.exp =
'Returns the value `e^x` (where `e` is the base of natural logarithms).'
math.floor =
'Returns the largest integral value smaller than or equal to `x`.'
math.fmod =
'Returns the remainder of the division of `x` by `y` that rounds the quotient towards zero.'
math.frexp =
'Decompose `x` into tails and exponents. Returns `m` and `e` such that `x = m * (2 ^ e)`, `e` is an integer and the absolute value of `m` is in the range [0.5, 1) (or zero when `x` is zero).'
math.huge =
'A value larger than any other numeric value.'
math.ldexp =
'Returns `m * (2 ^ e)` .'
math.log['<5.1'] =
'Returns the natural logarithm of `x` .'
math.log['>5.2'] =
'Returns the logarithm of `x` in the given base.'
math.log10 =
'Returns the base-10 logarithm of x.'
math.max =
'Returns the argument with the maximum value, according to the Lua operator `<`.'
math.maxinteger['>5.3'] =
'An integer with the maximum value for an integer.'
math.min =
'Returns the argument with the minimum value, according to the Lua operator `<`.'
math.mininteger['>5.3'] =
'An integer with the minimum value for an integer.'
math.modf =
'Returns the integral part of `x` and the fractional part of `x`.'
math.pi =
'The value of *π*.'
math.pow =
'Returns `x ^ y` .'
math.rad =
'Converts the angle `x` from degrees to radians.'
math.random =
[[
* `math.random()`: Returns a float in the range [0,1).
* `math.random(n)`: Returns a integer in the range [1, n].
* `math.random(m, n)`: Returns a integer in the range [m, n].
]]
math.randomseed['<5.3'] =
'Sets `x` as the "seed" for the pseudo-random generator.'
math.randomseed['>5.4'] =
[[
* `math.randomseed(x, y)`: Concatenate `x` and `y` into a 128-bit `seed` to reinitialize the pseudo-random generator.
* `math.randomseed(x)`: Equate to `math.randomseed(x, 0)` .
* `math.randomseed()`: Generates a seed with a weak attempt for randomness.
]]
math.sin =
'Returns the sine of `x` (assumed to be in radians).'
math.sinh =
'Returns the hyperbolic sine of `x` (assumed to be in radians).'
math.sqrt =
'Returns the square root of `x`.'
math.tan =
'Returns the tangent of `x` (assumed to be in radians).'
math.tanh =
'Returns the hyperbolic tangent of `x` (assumed to be in radians).'
math.tointeger['>5.3'] =
'If the value `x` is convertible to an integer, returns that integer.'
math.type['>5.3'] =
'Returns `"integer"` if `x` is an integer, `"float"` if it is a float, or `nil` if `x` is not a number.'
math.ult['>5.3'] =
'Returns `true` if and only if `m` is below `n` when they are compared as unsigned integers.'
os =
''
os.clock =
'Returns an approximation of the amount in seconds of CPU time used by the program.'
os.date =
'Returns a string or a table containing date and time, formatted according to the given string `format`.'
os.difftime =
'Returns the difference, in seconds, from time `t1` to time `t2`.'
os.execute =
'Passes `command` to be executed by an operating system shell.'
os.exit['<5.1'] =
'Calls the C function `exit` to terminate the host program.'
os.exit['>5.2'] =
'Calls the ISO C function `exit` to terminate the host program.'
os.getenv =
'Returns the value of the process environment variable `varname`.'
os.remove =
'Deletes the file with the given name.'
os.rename =
'Renames the file or directory named `oldname` to `newname`.'
os.setlocale =
'Sets the current locale of the program.'
os.time =
'Returns the current time when called without arguments, or a time representing the local date and time specified by the given table.'
os.tmpname =
'Returns a string with a file name that can be used for a temporary file.'
osdate.year =
'four digits'
osdate.month =
'1-12'
osdate.day =
'1-31'
osdate.hour =
'0-23'
osdate.min =
'0-59'
osdate.sec =
'0-61'
osdate.wday =
'weekday, 17, Sunday is 1'
osdate.yday =
'day of the year, 1366'
osdate.isdst =
'daylight saving flag, a boolean'
package =
''
require['<5.3'] =
'Loads the given module, returns any value returned by the given module(`true` when `nil`).'
require['>5.4'] =
'Loads the given module, returns any value returned by the searcher(`true` when `nil`). Besides that value, also returns as a second result the loader data returned by the searcher, which indicates how `require` found the module. (For instance, if the module came from a file, this loader data is the file path.)'
package.config =
'A string describing some compile-time configurations for packages.'
package.cpath =
'The path used by `require` to search for a C loader.'
package.loaded =
'A table used by `require` to control which modules are already loaded.'
package.loaders =
'A table used by `require` to control how to load modules.'
package.loadlib =
'Dynamically links the host program with the C library `libname`.'
package.path =
'The path used by `require` to search for a Lua loader.'
package.preload =
'A table to store loaders for specific modules.'
package.searchers =
'A table used by `require` to control how to load modules.'
package.searchpath =
'Searches for the given `name` in the given `path`.'
package.seeall =
'Sets a metatable for `module` with its `__index` field referring to the global environment, so that this module inherits values from the global environment. To be used as an option to function `module` .'
string =
''
string.byte =
'Returns the internal numeric codes of the characters `s[i], s[i+1], ..., s[j]`.'
string.char =
'Returns a string with length equal to the number of arguments, in which each character has the internal numeric code equal to its corresponding argument.'
string.dump =
'Returns a string containing a binary representation (a *binary chunk*) of the given function.'
string.find['>5.2'] =
'Looks for the first match of `pattern` (see §6.4.1) in the string.'
string.find['=5.1'] =
'Looks for the first match of `pattern` (see §5.4.1) in the string.'
string.format =
'Returns a formatted version of its variable number of arguments following the description given in its first argument.'
string.gmatch['>5.2'] =
[[
Returns an iterator function that, each time it is called, returns the next captures from `pattern` (see §6.4.1) over the string s.
As an example, the following loop will iterate over all the words from string s, printing one per line:
```lua
s =
"hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gmatch['=5.1'] =
[[
Returns an iterator function that, each time it is called, returns the next captures from `pattern` (see §5.4.1) over the string s.
As an example, the following loop will iterate over all the words from string s, printing one per line:
```lua
s =
"hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gsub['>5.2'] =
'Returns a copy of s in which all (or the first `n`, if given) occurrences of the `pattern` (see §6.4.1) have been replaced by a replacement string specified by `repl`.'
string.gsub['=5.1'] =
'Returns a copy of s in which all (or the first `n`, if given) occurrences of the `pattern` (see §5.4.1) have been replaced by a replacement string specified by `repl`.'
string.len =
'Returns its length.'
string.lower =
'Returns a copy of this string with all uppercase letters changed to lowercase.'
string.match['>5.2'] =
'Looks for the first match of `pattern` (see §6.4.1) in the string.'
string.match['=5.1'] =
'Looks for the first match of `pattern` (see §5.4.1) in the string.'
string.pack['>5.2'] =
'Returns a binary string containing the values `v1`, `v2`, etc. packed (that is, serialized in binary form) according to the format string `fmt` (see §6.4.2) .'
string.packsize['>5.2'] =
'Returns the size of a string resulting from `string.pack` with the given format string `fmt` (see §6.4.2) .'
string.rep['>5.2'] =
'Returns a string that is the concatenation of `n` copies of the string `s` separated by the string `sep`.'
string.rep['<5.1'] =
'Returns a string that is the concatenation of `n` copies of the string `s` .'
string.reverse =
'Returns a string that is the string `s` reversed.'
string.sub =
'Returns the substring of the string that starts at `i` and continues until `j`.'
string.unpack =
'Returns the values packed in string according to the format string `fmt` (see §6.4.2) .'
string.upper =
'Returns a copy of this string with all lowercase letters changed to uppercase.'
table =
''
table.concat =
'Given a list where all elements are strings or numbers, returns the string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
table.insert =
'Inserts element `value` at position `pos` in `list`.'
table.maxn =
'Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices.'
table.move =
[[
Moves elements from table `a1` to table `a2`.
```lua
a2[t],··· =
a1[f],···,a1[e]
return a2
```
]]
table.pack =
'Returns a new table with all arguments stored into keys `1`, `2`, etc. and with a field `"n"` with the total number of arguments.'
table.remove =
'Removes from `list` the element at position `pos`, returning the value of the removed element.'
table.sort =
'Sorts list elements in a given order, *in-place*, from `list[1]` to `list[#list]`.'
table.unpack =
[[
Returns the elements from the given list. This function is equivalent to
```lua
return list[i], list[i+1], ···, list[j]
```
By default, `i` is `1` and `j` is `#list`.
]]
table.foreach =
'Executes the given f over all elements of table. For each element, f is called with the index and respective value as arguments. If f returns a non-nil value, then the loop is broken, and this value is returned as the final value of foreach.'
table.foreachi =
'Executes the given f over the numerical indices of table. For each index, f is called with the index and respective value as arguments. Indices are visited in sequential order, from 1 to n, where n is the size of the table. If f returns a non-nil value, then the loop is broken and this value is returned as the result of foreachi.'
table.getn =
'Returns the number of elements in the table. This function is equivalent to `#list`.'
table.new =
[[This creates a pre-sized table, just like the C API equivalent `lua_createtable()`. This is useful for big tables if the final table size is known and automatic table resizing is too expensive. `narray` parameter specifies the number of array-like items, and `nhash` parameter specifies the number of hash-like items. The function needs to be required before use.
```lua
require("table.new")
```
]]
table.clear =
[[This clears all keys and values from a table, but preserves the allocated array/hash sizes. This is useful when a table, which is linked from multiple places, needs to be cleared and/or when recycling a table for use by the same context. This avoids managing backlinks, saves an allocation and the overhead of incremental array/hash part growth. The function needs to be required before use.
```lua
require("table.clear").
```
Please note this function is meant for very specific situations. In most cases it's better to replace the (usually single) link with a new table and let the GC do its work.
]]
utf8 =
''
utf8.char =
'Receives zero or more integers, converts each one to its corresponding UTF-8 byte sequence and returns a string with the concatenation of all these sequences.'
utf8.charpattern =
'The pattern which matches exactly one UTF-8 byte sequence, assuming that the subject is a valid UTF-8 string.'
utf8.codes =
[[
Returns values so that the construction
```lua
for p, c in utf8.codes(s) do
body
end
```
will iterate over all UTF-8 characters in string s, with p being the position (in bytes) and c the code point of each character. It raises an error if it meets any invalid byte sequence.
]]
utf8.codepoint =
'Returns the codepoints (as integers) from all characters in `s` that start between byte position `i` and `j` (both included).'
utf8.len =
'Returns the number of UTF-8 characters in string `s` that start between positions `i` and `j` (both inclusive).'
utf8.offset =
'Returns the position (in bytes) where the encoding of the `n`-th character of `s` (counting from position `i`) starts.'

View File

@@ -0,0 +1,480 @@
---@diagnostic disable: undefined-global
config.addonManager.enable =
"Whether the addon manager is enabled or not."
config.addonManager.repositoryBranch =
"Specifies the git branch used by the addon manager."
config.addonManager.repositoryPath =
"Specifies the git path used by the addon manager."
config.addonRepositoryPath =
"Specifies the addon repository path (not related to the addon manager)."
config.runtime.version =
"Lua runtime version."
config.runtime.path =
[[
When using `require`, how to find the file based on the input name.
Setting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.
if `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.
If you want to load files outside the workspace, you need to set `Lua.workspace.library` first.
]]
config.runtime.pathStrict =
'When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`.'
config.runtime.special =
[[The custom global variables are regarded as some special built-in variables, and the language server will provide special support
The following example shows that 'include' is treated as' require '.
```json
"Lua.runtime.special" : {
"include" : "require"
}
```
]]
config.runtime.unicodeName =
"Allows Unicode characters in name."
config.runtime.nonstandardSymbol =
"Supports non-standard symbols. Make sure that your runtime environment supports these symbols."
config.runtime.plugin =
"Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more."
config.runtime.pluginArgs =
"Additional arguments for the plugin."
config.runtime.fileEncoding =
"File encoding. The `ansi` option is only available under the `Windows` platform."
config.runtime.builtin =
[[
Adjust the enabled state of the built-in library. You can disable (or redefine) the non-existent library according to the actual runtime environment.
* `default`: Indicates that the library will be enabled or disabled according to the runtime version
* `enable`: always enable
* `disable`: always disable
]]
config.runtime.meta =
'Format of the directory name of the meta files.'
config.diagnostics.enable =
"Enable diagnostics."
config.diagnostics.disable =
"Disabled diagnostic (Use code in hover brackets)."
config.diagnostics.globals =
"Defined global variables."
config.diagnostics.globalsRegex =
"Find defined global variables using regex."
config.diagnostics.severity =
[[
Modify the diagnostic severity.
End with `!` means override the group setting `diagnostics.groupSeverity`.
]]
config.diagnostics.neededFileStatus =
[[
* Opened: only diagnose opened files
* Any: diagnose all files
* None: disable this diagnostic
End with `!` means override the group setting `diagnostics.groupFileStatus`.
]]
config.diagnostics.groupSeverity =
[[
Modify the diagnostic severity in a group.
`Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` separately.
Other settings will override individual settings without end of `!`.
]]
config.diagnostics.groupFileStatus =
[[
Modify the diagnostic needed file status in a group.
* Opened: only diagnose opened files
* Any: diagnose all files
* None: disable this diagnostic
`Fallback` means that diagnostics in this group are controlled by `diagnostics.neededFileStatus` separately.
Other settings will override individual settings without end of `!`.
]]
config.diagnostics.workspaceEvent =
"Set the time to trigger workspace diagnostics."
config.diagnostics.workspaceEvent.OnChange =
"Trigger workspace diagnostics when the file is changed."
config.diagnostics.workspaceEvent.OnSave =
"Trigger workspace diagnostics when the file is saved."
config.diagnostics.workspaceEvent.None =
"Disable workspace diagnostics."
config.diagnostics.workspaceDelay =
"Latency (milliseconds) for workspace diagnostics."
config.diagnostics.workspaceRate =
"Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also reduces the speed of workspace diagnostics. The diagnosis of the file you are currently editing is always done at full speed and is not affected by this setting."
config.diagnostics.libraryFiles =
"How to diagnose files loaded via `Lua.workspace.library`."
config.diagnostics.libraryFiles.Enable =
"Always diagnose these files."
config.diagnostics.libraryFiles.Opened =
"Only when these files are opened will it be diagnosed."
config.diagnostics.libraryFiles.Disable =
"These files are not diagnosed."
config.diagnostics.ignoredFiles =
"How to diagnose ignored files."
config.diagnostics.ignoredFiles.Enable =
"Always diagnose these files."
config.diagnostics.ignoredFiles.Opened =
"Only when these files are opened will it be diagnosed."
config.diagnostics.ignoredFiles.Disable =
"These files are not diagnosed."
config.diagnostics.disableScheme =
'Do not diagnose Lua files that use the following scheme.'
config.diagnostics.unusedLocalExclude =
'Do not diagnose `unused-local` when the variable name matches the following pattern.'
config.workspace.ignoreDir =
"Ignored files and directories (Use `.gitignore` grammar)."-- .. example.ignoreDir,
config.workspace.ignoreSubmodules =
"Ignore submodules."
config.workspace.useGitIgnore =
"Ignore files list in `.gitignore` ."
config.workspace.maxPreload =
"Max preloaded files."
config.workspace.preloadFileSize =
"Skip files larger than this value (KB) when preloading."
config.workspace.library =
"In addition to the current workspace, which directories will load files from. The files in these directories will be treated as externally provided code libraries, and some features (such as renaming fields) will not modify these files."
config.workspace.checkThirdParty =
[[
Automatic detection and adaptation of third-party libraries, currently supported libraries are:
* OpenResty
* Cocos4.0
* LÖVE
* LÖVR
* skynet
* Jass
]]
config.workspace.userThirdParty =
'Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd)'
config.workspace.supportScheme =
'Provide language server for the Lua files of the following scheme.'
config.completion.enable =
'Enable completion.'
config.completion.callSnippet =
'Shows function call snippets.'
config.completion.callSnippet.Disable =
"Only shows `function name`."
config.completion.callSnippet.Both =
"Shows `function name` and `call snippet`."
config.completion.callSnippet.Replace =
"Only shows `call snippet.`"
config.completion.keywordSnippet =
'Shows keyword syntax snippets.'
config.completion.keywordSnippet.Disable =
"Only shows `keyword`."
config.completion.keywordSnippet.Both =
"Shows `keyword` and `syntax snippet`."
config.completion.keywordSnippet.Replace =
"Only shows `syntax snippet`."
config.completion.displayContext =
"Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled."
config.completion.workspaceWord =
"Whether the displayed context word contains the content of other files in the workspace."
config.completion.showWord =
"Show contextual words in suggestions."
config.completion.showWord.Enable =
"Always show context words in suggestions."
config.completion.showWord.Fallback =
"Contextual words are only displayed when suggestions based on semantics cannot be provided."
config.completion.showWord.Disable =
"Do not display context words."
config.completion.autoRequire =
"When the input looks like a file name, automatically `require` this file."
config.completion.showParams =
"Display parameters in completion list. When the function has multiple definitions, they will be displayed separately."
config.completion.requireSeparator =
"The separator used when `require`."
config.completion.postfix =
"The symbol used to trigger the postfix suggestion."
config.color.mode =
"Color mode."
config.color.mode.Semantic =
"Semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect."
config.color.mode.SemanticEnhanced =
"Enhanced semantic color. Like `Semantic`, but with additional analysis which might be more computationally expensive."
config.color.mode.Grammar =
"Grammar color."
config.semantic.enable =
"Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect."
config.semantic.variable =
"Semantic coloring of variables/fields/parameters."
config.semantic.annotation =
"Semantic coloring of type annotations."
config.semantic.keyword =
"Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring."
config.signatureHelp.enable =
"Enable signature help."
config.hover.enable =
"Enable hover."
config.hover.viewString =
"Hover to view the contents of a string (only if the literal contains an escape character)."
config.hover.viewStringMax =
"The maximum length of a hover to view the contents of a string."
config.hover.viewNumber =
"Hover to view numeric content (only if literal is not decimal)."
config.hover.fieldInfer =
"When hovering to view a table, type infer will be performed for each field. When the accumulated time of type infer reaches the set value (MS), the type infer of subsequent fields will be skipped."
config.hover.previewFields =
"When hovering to view a table, limits the maximum number of previews for fields."
config.hover.enumsLimit =
"When the value corresponds to multiple types, limit the number of types displaying."
config.hover.expandAlias =
[[
Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.
]]
config.develop.enable =
'Developer mode. Do not enable, performance will be affected.'
config.develop.debuggerPort =
'Listen port of debugger.'
config.develop.debuggerWait =
'Suspend before debugger connects.'
config.intelliSense.searchDepth =
'Set the search depth for IntelliSense. Increasing this value increases accuracy, but decreases performance. Different workspace have different tolerance for this setting. Please adjust it to the appropriate value.'
config.intelliSense.fastGlobal =
'In the global variable completion, and view `_G` suspension prompt. This will slightly reduce the accuracy of type speculation, but it will have a significant performance improvement for projects that use a lot of global variables.'
config.window.statusBar =
'Show extension status in status bar.'
config.window.progressBar =
'Show progress bar in status bar.'
config.hint.enable =
'Enable inlay hint.'
config.hint.paramType =
'Show type hints at the parameter of the function.'
config.hint.setType =
'Show hints of type at assignment operation.'
config.hint.paramName =
'Show hints of parameter name at the function call.'
config.hint.paramName.All =
'All types of parameters are shown.'
config.hint.paramName.Literal =
'Only literal type parameters are shown.'
config.hint.paramName.Disable =
'Disable parameter hints.'
config.hint.arrayIndex =
'Show hints of array index when constructing a table.'
config.hint.arrayIndex.Enable =
'Show hints in all tables.'
config.hint.arrayIndex.Auto =
'Show hints only when the table is greater than 3 items, or the table is a mixed table.'
config.hint.arrayIndex.Disable =
'Disable hints of array index.'
config.hint.await =
'If the called function is marked `---@async`, prompt `await` at the call.'
config.hint.awaitPropagate =
'Enable the propagation of `await`. When a function calls a function marked `---@async`,\z
it will be automatically marked as `---@async`.'
config.hint.semicolon =
'If there is no semicolon at the end of the statement, display a virtual semicolon.'
config.hint.semicolon.All =
'All statements display virtual semicolons.'
config.hint.semicolon.SameLine =
'When two statements are on the same line, display a semicolon between them.'
config.hint.semicolon.Disable =
'Disable virtual semicolons.'
config.codeLens.enable =
'Enable code lens.'
config.format.enable =
'Enable code formatter.'
config.format.defaultConfig =
[[
The default format configuration. Has a lower priority than `.editorconfig` file in the workspace.
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.spell.dict =
'Custom words for spell checking.'
config.nameStyle.config =
[[
Set name style config.
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.telemetry.enable =
[[
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).
]]
config.misc.parameters =
'[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language server in VSCode.'
config.misc.executablePath =
'Specify the executable path in VSCode.'
config.language.fixIndent =
'(VSCode only) Fix incorrect auto-indentation, such as incorrect indentation when line breaks occur within a string containing the word "function".'
config.language.completeAnnotation =
'(VSCode only) Automatically insert "---@ " after a line break following a annotation.'
config.type.castNumberToInteger =
'Allowed to assign the `number` type to the `integer` type.'
config.type.weakUnionCheck =
[[
Once one subtype of a union type meets the condition, the union type also meets the condition.
When this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.
]]
config.type.weakNilCheck =
[[
When checking the type of union type, ignore the `nil` in it.
When this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.
]]
config.type.inferParamType =
[[
When a parameter type is not annotated, it is inferred from the function's call sites.
When this setting is `false`, the type of the parameter is `any` when it is not annotated.
]]
config.type.checkTableShape =
[[
Strictly check the shape of the table.
]]
config.type.inferTableSize =
'Maximum number of table fields analyzed during type inference.'
config.doc.privateName =
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
config.doc.protectedName =
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
config.doc.packageName =
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
config.doc.regengine =
'The regular expression engine used for matching documentation scope names.'
config.doc.regengine.glob =
'The default lightweight pattern syntax.'
config.doc.regengine.lua =
'Full Lua-style regular expressions.'
config.docScriptPath =
'The regular expression engine used for matching documentation scope names.'
config.diagnostics['unused-local'] =
'Enable unused local variable diagnostics.'
config.diagnostics['unused-function'] =
'Enable unused function diagnostics.'
config.diagnostics['undefined-global'] =
'Enable undefined global variable diagnostics.'
config.diagnostics['global-in-nil-env'] =
'Enable cannot use global variables `_ENV` is set to `nil` diagnostics.'
config.diagnostics['unused-label'] =
'Enable unused label diagnostics.'
config.diagnostics['unused-vararg'] =
'Enable unused vararg diagnostics.'
config.diagnostics['trailing-space'] =
'Enable trailing space diagnostics.'
config.diagnostics['redefined-local'] =
'Enable redefined local variable diagnostics.'
config.diagnostics['newline-call'] =
'Enable newline call diagnostics. It\'s raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.'
config.diagnostics['newfield-call'] =
'Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.'
config.diagnostics['redundant-parameter'] =
'Enable redundant function parameter diagnostics.'
config.diagnostics['ambiguity-1'] =
'Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.'
config.diagnostics['lowercase-global'] =
'Enable lowercase global variable definition diagnostics.'
config.diagnostics['undefined-env-child'] =
'Enable undefined environment variable diagnostics. It\'s raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.'
config.diagnostics['duplicate-index'] =
'Enable duplicate table index diagnostics.'
config.diagnostics['empty-block'] =
'Enable empty code block diagnostics.'
config.diagnostics['redundant-value'] =
'Enable the redundant values assigned diagnostics. It\'s raised during assignment operation, when the number of values is higher than the number of objects being assigned.'
config.diagnostics['assign-type-mismatch'] =
'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.'
config.diagnostics['await-in-sync'] =
'Enable diagnostics for calls of asynchronous functions within a synchronous function.'
config.diagnostics['cast-local-type'] =
'Enable diagnostics for casts of local variables where the target type does not match the defined type.'
config.diagnostics['cast-type-mismatch'] =
'Enable diagnostics for casts where the target type does not match the initial type.'
config.diagnostics['circular-doc-class'] =
'Enable diagnostics for two classes inheriting from each other introducing a circular relation.'
config.diagnostics['close-non-object'] =
'Enable diagnostics for attempts to close a variable with a non-object.'
config.diagnostics['code-after-break'] =
'Enable diagnostics for code placed after a break statement in a loop.'
config.diagnostics['codestyle-check'] =
'Enable diagnostics for incorrectly styled lines.'
config.diagnostics['count-down-loop'] =
'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.'
config.diagnostics['deprecated'] =
'Enable diagnostics to highlight deprecated API.'
config.diagnostics['different-requires'] =
'Enable diagnostics for files which are required by two different paths.'
config.diagnostics['discard-returns'] =
'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.'
config.diagnostics['doc-field-no-class'] =
'Enable diagnostics to highlight a field annotation without a defining class annotation.'
config.diagnostics['duplicate-doc-alias'] =
'Enable diagnostics for a duplicated alias annotation name.'
config.diagnostics['duplicate-doc-field'] =
'Enable diagnostics for a duplicated field annotation name.'
config.diagnostics['duplicate-doc-param'] =
'Enable diagnostics for a duplicated param annotation name.'
config.diagnostics['duplicate-set-field'] =
'Enable diagnostics for setting the same field in a class more than once.'
config.diagnostics['incomplete-signature-doc'] =
'Incomplete @param or @return annotations for functions.'
config.diagnostics['invisible'] =
'Enable diagnostics for accesses to fields which are invisible.'
config.diagnostics['missing-global-doc'] =
'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.'
config.diagnostics['missing-local-export-doc'] =
'Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.'
config.diagnostics['missing-parameter'] =
'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.'
config.diagnostics['missing-return'] =
'Enable diagnostics for functions with return annotations which have no return statement.'
config.diagnostics['missing-return-value'] =
'Enable diagnostics for return statements without values although the containing function declares returns.'
config.diagnostics['need-check-nil'] =
'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.'
config.diagnostics['unnecessary-assert'] =
'Enable diagnostics for redundant assertions on truthy values.'
config.diagnostics['no-unknown'] =
'Enable diagnostics for cases in which the type cannot be inferred.'
config.diagnostics['not-yieldable'] =
'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.'
config.diagnostics['param-type-mismatch'] =
'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.'
config.diagnostics['redundant-return'] =
'Enable diagnostics for return statements which are not needed because the function would exit on its own.'
config.diagnostics['redundant-return-value']=
'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.'
config.diagnostics['return-type-mismatch'] =
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
config.diagnostics['spell-check'] =
'Enable diagnostics for typos in strings.'
config.diagnostics['name-style-check'] =
'Enable diagnostics for name style.'
config.diagnostics['unbalanced-assignments']=
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
config.diagnostics['undefined-doc-class'] =
'Enable diagnostics for class annotations in which an undefined class is referenced.'
config.diagnostics['undefined-doc-name'] =
'Enable diagnostics for type annotations referencing an undefined type or alias.'
config.diagnostics['undefined-doc-param'] =
'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.'
config.diagnostics['undefined-field'] =
'Enable diagnostics for cases in which an undefined field of a variable is read.'
config.diagnostics['unknown-cast-variable'] =
'Enable diagnostics for casts of undefined variables.'
config.diagnostics['unknown-diag-code'] =
'Enable diagnostics in cases in which an unknown diagnostics code is entered.'
config.diagnostics['unknown-operator'] =
'Enable diagnostics for unknown operators.'
config.diagnostics['unreachable-code'] =
'Enable diagnostics for unreachable code.'
config.diagnostics['global-element'] =
'Enable diagnostics to warn about global elements.'
config.typeFormat.config =
'Configures the formatting behavior while typing Lua code.'
config.typeFormat.config.auto_complete_end =
'Controls if `end` is automatically completed at suitable positions.'
config.typeFormat.config.auto_complete_table_sep =
'Controls if a separator is automatically appended at the end of a table declaration.'
config.typeFormat.config.format_line =
'Controls if a line is formatted at all.'
command.exportDocument =
'Lua: Export Document ...'
command.addon_manager.open =
'Lua: Open Addon Manager ...'
command.reloadFFIMeta =
'Lua: Reload luajit ffi meta'
command.startServer =
'Lua: Restart Language Server'
command.stopServer =
'Lua: Stop Language Server'

View File

@@ -0,0 +1,764 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
'Argumentos de línea de comandos para Lua Standalone.'
assert =
'Alsa un error si el valor de sus argumentos es falso. (ej: `nil` ó `falso`); de lo contrario, retorna todos sus argumentos. En caso de error, `message` es el mensaje de error; cuando se omite, el valor predeterminado es `"assertion failed!"`'
cgopt.collect =
'Realiza un ciclo completo de recolección de basura.'
cgopt.stop =
'Detiene la ejecución automática.'
cgopt.restart =
'Reinicia la ejecución automática.'
cgopt.count =
'Retorna el total de memoria en Kbytes.'
cgopt.step =
'Realiza un paso de recolección de basura.'
cgopt.setpause =
'Establece la pausa.'
cgopt.setstepmul =
'Establece el multiplicador para el paso de recolección de basura.'
cgopt.incremental =
'Cambia el modo de recolección a incremental.'
cgopt.generational =
'Cambia el modo de recolección a generacional.'
cgopt.isrunning =
'Retorna si el recolector está corriendo.'
collectgarbage =
'Esta función es una interfaz genérica al recolector de basura. Realiza diferentes funcionalidades según su primer argumento `opt`'
dofile =
'Abre el archivo mencionado y ejecuta su contenido como un bloque Lua. Cuando es llamada sin argumentos, `dofile` ejecuta el contenido de la entrada estándar (`stdin`). Retorna todos los valores retornado por el bloque. En caso de error `dofile` propaga el error a la función que la llama. (Eso sí, `dofile` no corre en modo protegido.)'
error =
[[
Termina la última función llamada y retorna el mensaje como el objecto de error.
Normalmente `error` tiene información extra acerca la posición del error al inicio del mensaje, si es que éste es un string.
]]
_G =
'Una variable global (no una función) que tiene el ambiente global (véase §2.2). Esta variable no se ocupa en Lua mismo; el cambiar su valor no afecta a ningún ambiente y vice-versa.'
getfenv =
'Retorna el ambiente que usa la función actualmente. `f` puede ser una función de Lua o un número que especifica la función en ese nivel de la pila de llamadas.'
getmetatable =
'Si el objecto no tiene una metatabla, returna nil. Si no, si la metatabla del objeto tiene un campo __metatable, retorna el valor asociado. Si tampoco es así, retorna la metatabla del objeto dado.'
ipairs =
[[
Retorna tres valores (una función iteradora, la tabla `t` y `0`) cosa que la estructura
```lua
for i,v in ipairs(t) do body end
```
itera sobre los pares clave-valor `(1,t[1]), (2,t[2]), ...`, hasta el primer índice ausente.
]]
loadmode.b =
'Solo bloques binarios.'
loadmode.t =
'Solo bloques de texto.'
loadmode.bt =
'Bloques binarios y de texto.'
load['<5.1'] =
'Carga un bloque usando la función `func` para obtener sus partes. Cada llamada a `func` debe retornar un string que se concatena con los resultados anteriores.'
load['>5.2'] =
[[
Carga un bloque.
Si `chunk` es un string, el bloque es este string. Si `chunk` es una función, entonces `load` la llama repetidas veces para obtener las partes del bloque. Cada llamada a `chunk` debe retornar un string que se concatena con los resultados anteriores. El retornar un string vacío, `nil` ó ningún valor señala el fin del bloque.
]]
loadfile =
'Carga un bloque del archivo `filename` o de la entrada estándar, si es que no se provee un nombre de archivo.'
loadstring =
'Carga un bloque del string dado.'
module =
'Crea un módulo.'
next =
[[
Le permite a un programa recorrer todos los campos de una tabla. El primer argumento es una tabla y el segundo es un índice de ésta. Un llamado a `next` retorna el siguiente índice de la tabla y su valor asociado. Cuando se llama con `nil` como segundo argumento, `next` retorna un índicie inicial y su valor asociado. Cuando se llama con el último índice, o con `nil` en una tabla vacía, `next` retorna `nil`. Si se omite el segundo argumento, entonces se le interpreta como `nil`. En particular, se puede llamara a `next(t)` para chequear si la tabla está vacía.
El orden en el cual los índices son enumerados no está especificado, *incluso para índices numéricos*. (Para recorrer una tabla en orden numérico, se debe usar un `for` numérico.)
El comportamiento de `next` no está definido si, durante un recorrido, se le asigna algún valor a un campo no existente de la tabla. Sin embargo, sí se pueden modificar los campos existentes. En particular, se pueden asignar campos existentes a `nil`.
]]
pairs =
[[
Si `t` tiene un metamétodo `__pairs`, la llama con t como argumento y retorna los primeros tres resultados de la llamada.
Caso contrario, retorna tres valores: la función $next, la tabla `t`, y `nil` para que el bloque
```lua
for k,v in pairs(t) do body end
```
itere sobre todos los pares clave-valor de la tabla `t`.
Vea la función $next para más detalles acerca de las limitaciones al modificar la tabla mientras se le recorre.
]]
pcall =
[[
Llama a la función `f` con los argumentos provistos en *modo protegido*. Esto significa que cualquier error que ocurra dentro de `f` no es propagado; en vez de eso, `pcall` atrapa el error y retorna un código de estado. El primer resultado es el código de estado (verdadero/falso), si éste es verdadero, entonces la llamada fue completada sin errores. En tal caso, `pcall` también retorna todos los resultados de la llamada, después de este primer resultado. En caso de error, `pcall` retorna `false` junto al objeto de error.
]]
print =
[[
Recibe cualquier número de argumentos e imprime sus valores a la salida estándar `stdout`, convirtiendo cada argumento a texto siguiendo las mismas reglas de $tostring.
La función `print` no está hecha para una salida formateada, si no que solo como una manera rápida de mostrar un valor, por ejemplo, para depurar. Para un control completo sobre la salida use $string.format e $io.write.
]]
rawequal =
'Revisa que v1 sea igual a v2, sin llamar al metamétodo `__eq`.'
rawget =
'Obtiene el valor real de `table[index]`, sin llamar al metamétodo `__index`.'
rawlen =
'Retorna el largo del objeto `v`, sin invocar al metamétodo `__len`.'
rawset =
[[
Asigna el valor real de `table[index]` a `value`, sin usar el metavalor `__newindex`. `table` debe ser una tabla, `index` cualquier valor distinto de `nil` y `NaN`, y `value` cualquier valor de Lua.
Esta función retorna `table`.
]]
select =
'Si `index` es un número retorna todos los argumentos que siguen al `index`-ésimo argumento; un número negativo indiza desde el final (`-1` es el último argumento). Caso contrario, `index` debe ser el texto `"#"` y `select` retorna el número total de argumentos extra recibidos.'
setfenv =
'Asigna el ambiente para ser usado para la función provista.'
setmetatable =
[[
Asigna la metatabla para la tabla provista. Si `metatable` is `nil`, remueve la metatabla de tabla provista. Si la tabla original tiene un campo `__metatable`, alza un error.
Esta función retorna `table`.
Para cambiar la metatabla de otros tipos desde código Lua, se debe usar la biblioteca de depuración (§6.10).
]]
tonumber =
[[
Cuando se llama sin `base`, `toNumber` intenta convertir el argumento a un número. Si el argumento ya es un número o un texto convertible a un número, entonces `tonumber` retorna este número; si no es el caso, retorna `fail`
La conversión de strings puede resultar en enteros o flotantes, de acuerdo a las convenciones léxicas de Lua (véase §3.1). El string puede tener espacios al principio, al final y tener un signo.
]]
tostring =
[[
Recibe un valor de cualquier tipo y lo convierte en un string en un formato legible.
Si la metatabla de `v` tiene un campo `__tostring`, entonces `tostring` llama al valor correspondiente con `v` como argumento y usa el resultado de la llamada como su resultado. Si no lo tiene y si la metatabla de `v` tiene un campo `__name` con un valor de tipo string, `tostring` podría ocupar este valor en su resultado final.
Para un control completo de cómo se convierten los números, use $string.format.
]]
type =
[[
Retorna el tipo de su único argumento, codificado como string. Los resultados posibles de esta función son `"nil"` (un string, no el valor `nil`), `"number"`, `"string"`, `"boolean"`, `"table"`, `"function"`, `"thread"`, y `"userdata"`.
]]
_VERSION =
'Una variable global (no una función) que contiene un string con la versión de Lua en ejecución.'
warn =
'Emite una advertencia con un mensaje compuesto por la concatenación de todos sus argumentos (todos estos deben ser strings).'
xpcall['=5.1'] =
'Llama a la función `f` con los argumentos provistos en modo protegido con un nuevo manejador de mensaje.'
xpcall['>5.2'] =
'Llama a la función `f` con los argumentos provistos en modo protegido con un nuevo manejador de mensaje.'
unpack =
[[
Retorna los elementos de la lista provista. Esta función es equivalente a
```lua
return list[i], list[i+1], ···, list[j]
```
]]
bit32 =
''
bit32.arshift =
[[
Retorna el número `x` desplazado `disp` bits a la derecha. Los desplazamientos negativos lo hacen a la izquierda.
Esta operación de desplazamiento es lo que se llama desplazamiento aritmético. Los bits vacíos del lado izquierdo se llenan con copias del bit más alto de `x`; los bits vacíos del lado derecho se llenan con ceros.
]]
bit32.band =
'Retorna la operación lógica *and* de sus operandos.'
bit32.bnot =
[[
Retorna la negación lógica de `x` a nivel de bits.
```lua
assert(bit32.bnot(x) ==
(-1 - x) % 2^32)
```
]]
bit32.bor =
'Retorna la operación lógica *or* de sus operandos.'
bit32.btest =
'Retorna un booleano señalando si la operación lógica *and* a nivel de bits de sus operandos es diferente de cero.'
bit32.bxor =
'Retorna la operación lógica *xor* de sus operandos.'
bit32.extract =
'Retorna el número sin signo formado por los bits `field` hasta `field + width - 1` desde `n`.'
bit32.replace =
'Retorna una copia de `n` con los bits `field` a `field + width - 1` remplazados por el valor `v` .'
bit32.lrotate =
'Retorna el número `x` rotado `disp` bits a la izquierda. Las rotaciones negativas lo hacen a la derecha.'
bit32.lshift =
[[
Retorna el número `x` desplazado `disp` bits a la izquierda. Los desplazamientos negativos lo hacen a la derecha. En cualquier dirección, los bits vacíos se llenan con ceros.
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
bit32.rrotate =
'Retorna el número `x` rotado `disp` bits a la derecha. Las rotaciones negativas lo hacen a la izquierda.'
bit32.rshift =
[[
Retorna el número `x` desplazado `disp` bits a la derecha. Los desplazamientos negativos lo hacen a la izquierda. En cualquier dirección, los bits vacíos se llenan con ceros.
```lua
assert(bit32.rshift(b, disp) ==
math.floor(b % 2^32 / 2^disp))
```
]]
coroutine =
''
coroutine.create =
'Crea una co-rutina nueva con cuerpo `f`. `f` debe ser una función. Retorna esta nueva co-rutina, un objeto con tipo `thread`.'
coroutine.isyieldable =
'Retorna verdadero cuando la co-rutina en ejecución puede suspenderse cediendo el control.'
coroutine.isyieldable['>5.4']=
'Retorna verdadero cuando la co-rutina `co` puede suspenderse cediendo el control. El valor predeterminado para `co` es la co-rutina actualmente en ejecución.'
coroutine.close =
'Cierra la co-rutina `co`, cerrando todas sus variables prontas a cerrarse, dejando la co-rutina en un estado muerto.'
coroutine.resume =
'Empieza o continua la ejecución de la co-rutina `co`.'
coroutine.running =
'Retorna la co-rutina en ejecución con un booleano adicional, señalando si la co-rutina en ejecución es la principal.'
coroutine.status =
'Retorna el estado de la co-rutina `co`.'
coroutine.wrap =
'Crea una co-rutina nueva con cuerpo `f`; `f` debe ser una función. Retorna una función que resume la co-rutina cada vez que se le llama.'
coroutine.yield =
'Suspende la ejecución de la co-rutina que le llama, cediendo el control.'
costatus.running =
'Está corriendo.'
costatus.suspended =
'Está suspendida o no ha empezado.'
costatus.normal =
'Está activa, pero no en ejecución.'
costatus.dead =
'Ha terminado o se detuvo con un error.'
debug =
''
debug.debug =
'Entra a un modo interactivo con el usuario, ejecutando cada string que el usuario ingrese.'
debug.getfenv =
'Retorna el ambiente del objeto `o` .'
debug.gethook =
'Retorna las configuraciones `hook` de la hebra.'
debug.getinfo =
'Retorna una tabla con información acerca de una función.'
debug.getlocal['<5.1'] =
'Retorna el nombre y el valor de la variable local con índice `local` de la función en el nivel `level` de la pila.'
debug.getlocal['>5.2'] =
'Retorna el nombre y el valor de la variable local con índice `local` de la función en el nivel `f` de la pila.'
debug.getmetatable =
'Retorna la metatabla del valor provisto.'
debug.getregistry =
'Retorna la tabla de registro.'
debug.getupvalue =
'Retorna el nombre y el valor de la variable anterior con índice `up` de la función.'
debug.getuservalue['<5.3'] =
'Retorna el valor de Lua asociado a u.'
debug.getuservalue['>5.4'] =
[[
Retorna el `n`-ésimo valor asociado
a la data de usuario `u` con un booleano adicional,
`false` si la data de usuario no tiene ese valor.
]]
debug.setcstacklimit =
[[
### **Obsoleto desde `Lua 5.4.2`**
Asigna un límite nuevo para la pila C. Este límite controla qué tan profundo pueden llegar las llamadas anidadas en Lua con la intención de evitar un desbordamiento de la pila (stack overflow).
En caso de éxito, esta función retorna el límite anterior. En caso de error, retorna `false`.
]]
debug.setfenv =
'Asigna el ambiente del objeto `object` provisto a la tabla `table` provista.'
debug.sethook =
'Asigna la función provista como un `hook`.'
debug.setlocal =
'Asigna el valor `value` a la variable local con índice `local` de la función en el nivel `level` de la pila.'
debug.setmetatable =
'Asigna la metatabla del valor provisto a la tabla provista (la cual puede ser `nil`).'
debug.setupvalue =
'Asigna el valor `value` al valor anterior con índice `up` de la función.'
debug.setuservalue['<5.3'] =
'Asigna el valor provisto como el valor de Lua asociado a la provista data de usuario `udata`.'
debug.setuservalue['>5.4'] =
[[
Asigna el valor `value` como
el `n`-ésimo valor asociado a la data de usuario `udata` provista.
`udata` debe ser data de usuario completa.
]]
debug.traceback =
'Retorna un string con la traza de la pila de llamadas. El string de mensaje opcional está anexado al principio de la traza.'
debug.upvalueid =
'Retorna un identificador único (como data de usuario ligera) para el valor anterior número `n` de la función provista.'
debug.upvaluejoin =
'Hace que el `n1`-ésimo valor anterior de la clausura de Lua `f1` se refiera a el `n2`-ésimo valor anterior de la clausura de Lua `f2`.'
infowhat.n =
'`name` y `namewhat`'
infowhat.S =
'`source`, `short_src`, `linedefined`, `lastlinedefined`, y `what`'
infowhat.l =
'`currentline`'
infowhat.t =
'`istailcall`'
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
'`nups`, `nparams`, y `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
'`ftransfer` y `ntransfer`'
infowhat.L =
'`activelines`'
hookmask.c =
'Llama al hook cuando se llama a una función desde Lua.'
hookmask.r =
'Llama al hook cuand se retorna de una función desde Lua.'
hookmask.l =
'Llama al hook cuand se entra a una nueva línea de código desde Lua.'
file =
''
file[':close'] =
'Cierra el archivo `file`.'
file[':flush'] =
'Guarda la data escrita al archivo `file`.'
file[':lines'] =
[[
------
```lua
for c in file:lines(...) do
body
end
```
]]
file[':read'] =
'Lee el archivo `file`, de acuerdo a los formatos provistos, los cuales especifican qué leer.'
file[':seek'] =
'Fija y obtiene la posición del archivo, a contar del principio del archivo.'
file[':setvbuf'] =
'Fija el modo de buffer para un archivo de salida.'
file[':write'] =
'Escribe el valor de cada uno de sus argumentos al archivo`file`.'
readmode.n =
'Lee un numeral y lo devuelve como un número.'
readmode.a =
'Lee todo el archivo.'
readmode.l =
'Lee la siguiente línea, saltándose el fin-de-línea.'
readmode.L =
'Lee la siguiente línea, manteniendo el fin-de-línea.'
seekwhence.set =
'Sitúa la posición base está al inicio del archivo.'
seekwhence.cur =
'Sitúa la posición base en la actual.'
seekwhence['.end'] =
'Sitúa la posición base al final del archivo.'
vbuf.no =
'La salida de la operación aparece de inmediato.'
vbuf.full =
'Realizado solo cuando el `buffer` está lleno.'
vbuf.line =
'Almacenado en el `buffer` hasta que se encuentra un salto de línea en la salida.'
io =
''
io.stdin =
'Entrada estándar.'
io.stdout =
'Salida estándar.'
io.stderr =
'Salida de error estándar.'
io.close =
'Cierra el archivo `file` o el archivo de salida predeterminado.'
io.flush =
'Guarda la data escrita al archivo de salida predeterminado.'
io.input =
'Asigna `file` como el archivo de entrada predeterminado.'
io.lines =
[[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
io.open =
'Abre un archivo en el modo especificado en el string `mode`.'
io.output =
'Asigna `file` como el archivo de salida predeterminado.'
io.popen =
'Inicia el programa provisto como un proceso separado.'
io.read =
'Lee el archivo de acuerdo a los formatos provistos, los cuales especifican qué leer.'
io.tmpfile =
'En caso de éxito retorna un descriptor de archvivo a un archivo temporal.'
io.type =
'Verifica si el objeto `obj` es un descriptor de archivo válido.'
io.write =
'Escribe el valor de cada uno de sus argumentos al archivo de salida predeterminado.'
openmode.r =
'Modo de lectura.'
openmode.w =
'Modo de escritura.'
openmode.a =
'Modo de agregado.'
openmode['.r+'] =
'Modo de actualización, toda data existente es preservada.'
openmode['.w+'] =
'Modo de actualización, toda data existente es borrada.'
openmode['.a+'] =
'Modo de agregado y actualización, toda data existente es preservada, la escritura solo es permitida al final del archivo.'
openmode.rb =
'Modo de lectura. (en modo binario)'
openmode.wb =
'Modo de escritura. (en modo binario)'
openmode.ab =
'Modo de agregado. (en modo binario)'
openmode['.r+b'] =
'Modo de actualización, toda data existente es preservada. (en modo binario)'
openmode['.w+b'] =
'Modo de actualización, toda data existente es borrada. (en modo binario)'
openmode['.a+b'] =
'Modo de agregado y actualización, toda data existente es preservada, la escritura solo es permitida al final del archivo. (en modo binario)'
popenmode.r =
'Lee data the este programa por archivo `file`.'
popenmode.w =
'Escribe data the este programa por archivo `file`.'
filetype.file =
'Es un descriptor de archivo abierto.'
filetype['.closed file'] =
'Es un descriptor de archivo cerrado.'
filetype['.nil'] =
'No es un descriptor de archivo.'
math =
''
math.abs =
'Retorna el valor absoluto de `x`.'
math.acos =
'Retorna el arcocoseno de `x` (en radianes).'
math.asin =
'Retorna el arcoseno de `x` (en radianes).'
math.atan['<5.2'] =
'Retorna el arcotangente de `x` (en radianes).'
math.atan['>5.3'] =
'Retorna el arcotangente de `y/x` (en radianes).'
math.atan2 =
'Retorna el arcotangente de `y/x` (en radianes).'
math.ceil =
'Retorna el menor valor integral mayor o igual a `x`.'
math.cos =
'Retorna el coseno de `x` (se asume que está en radianes).'
math.cosh =
'Retorna el coseno hiperbólico de `x` (se asume que está en radianes).'
math.deg =
'Convierte el ángulo `x` de radianes a grados.'
math.exp =
'Retorna el valor `e^x` (donde `e` es la base del logaritmo natural).'
math.floor =
'Retorna el mayor valor integral más menor o igual a `x`.'
math.fmod =
'Retorna el resto de la división de `x` por `y` que redondea el cuociente hacia cero.'
math.frexp =
'Descompone `x` en mantisa y exponente. Retorna `m` y `e` tal que `x = m * (2 ^ e)`, `e` es un entero y el valor absoluto de `m` está en el rango [0.5, 1) (ó cero cuando `x` es cero).'
math.huge =
'Un valor mayor que cualquier otro valor numérico.'
math.ldexp =
'Retorna `m * (2 ^ e)` .'
math.log['<5.1'] =
'Retorna el logaritmo natural de `x` .'
math.log['>5.2'] =
'Retorna el logaritmo de `x` en la base provista.'
math.log10 =
'Retorna el logaritmo en base 10 de `x` .'
math.max =
'Retorna el argumento con el valor máximo, de acuerdo al operador de Lua `<`.'
math.maxinteger['>5.3'] =
'Un entero con el valor máximo para un entero.'
math.min =
'Retorna el argumento con el valor mínimo, de acuerdo al operador de Lua `<`.'
math.mininteger['>5.3'] =
'Un entero con el valor mínimo para un entero.'
math.modf =
'Retorna la parte integral de `x` y la parte fraccional de `x`.'
math.pi =
'El valor de *π*.'
math.pow =
'Retorna `x ^ y` .'
math.rad =
'Convierte el ángulo `x` de grados a radianes.'
math.random =
[[
* `math.random()`: Returns a float in the range [0,1).
* `math.random(n)`: Returns a integer in the range [1, n].
* `math.random(m, n)`: Returns a integer in the range [m, n].
]]
math.randomseed['<5.3'] =
'Asigna `x` como el valor de semilla para el generador de números pseudo-aleatorios.'
math.randomseed['>5.4'] =
[[
* `math.randomseed(x, y)`: Concatenate `x` and `y` into a 128-bit `seed` to reinitialize the pseudo-random generator.
* `math.randomseed(x)`: Equate to `math.randomseed(x, 0)` .
* `math.randomseed()`: Generates a seed with a weak attempt for randomness.
]]
math.sin =
'Retorna el seno de `x` (se asume que está en radianes).'
math.sinh =
'Retorna el seno hiperbólico de `x` (se asume que está en radianes).'
math.sqrt =
'Retorna la raíz cuadrada de `x`.'
math.tan =
'Retorna la tangente de `x` (se asume que está en radianes).'
math.tanh =
'Retorna la tangente hiperbólica de `x` (se asume que está en radianes).'
math.tointeger['>5.3'] =
'Si el valor de `x` se puede convertir a un entero, retorna ese entero.'
math.type['>5.3'] =
'Retorna `"integer"` si `x` es un entero, `"float"` si es un flotante ó `nil` si `x` no es un número.'
math.ult['>5.3'] =
'Retorna `true` si y sólo si `m` es menor que `n` cuando son comparados como enteros sin signo.'
os =
''
os.clock =
'Retorna una aproximación de la cantidad de segundos en tiempo de CPU usado por el programa.'
os.date =
'Retorna un string o una tabla que contiene la fecha y el tiempo, formateados de acuerdo al string `format` provisto.'
os.difftime =
'Retorna la diferencia, en segundos, desde el tiempo `t1` al tiempo `t2`.'
os.execute =
'Pasa el comando `command` para ser ejecutado por una llamada al intérprete *shell* del sistema operativo.'
os.exit['<5.1'] =
'Llama la función de C `exit` para terminar el programa anfitrión.'
os.exit['>5.2'] =
'Llama la función de C ISO `exit` para terminar el programa anfitrión.'
os.getenv =
'Retorna el valor de la variable `varname` del ambiente del proceso.'
os.remove =
'Borra el archivo con el nombre provisto.'
os.rename =
'Renombra el archivo o directorio con nombre `oldname` al nuevo `newname`.'
os.setlocale =
'Fija la localización linguística actual del programa.'
os.time =
'Retorna el tiempo actual cuando se le llama sin argumentos o el tiempo que representa la fecha y hora local especificadas por la tabla provista.'
os.tmpname =
'Retorna un string con un nombre de archivo que puede ser usado como archivo temporal.'
osdate.year =
'cuatro dígitos'
osdate.month =
'1-12'
osdate.day =
'1-31'
osdate.hour =
'0-23'
osdate.min =
'0-59'
osdate.sec =
'0-61'
osdate.wday =
'día de la semana, 1-7, Domingo es 1'
osdate.yday =
'día del año, 1366'
osdate.isdst =
'indicador de horario de verano, un booleano'
package =
''
require['<5.3'] =
'Carga el módulo provisto, retorna cualquier valor retornado por el módulo provisto (`true` cuando es `nil`).'
require['>5.4'] =
'Carga el módulo provisto, retorna cualquier valor retornado por el buscador (`true` cuando es `nil`). Aparte de ese valor, también retorna el cargador de datos retornados por el buscador como segundo resultado, lo que indica cómo `require` encontró el módulo. (Por ejemplo, si el módulo viene de un archivo, los datos del cargador son la ruta a dicho archivo.'
package.config =
'Un string describiendo algunas configuracions en tiempo de compilación para los paquetes.'
package.cpath =
'La ruta usada por `require` para buscar por un cargador de C.'
package.loaded =
'Una tabla usada por `require` para controlar qué módulos ya se han cargado.'
package.loaders =
'Una tabla usada por `require` para controlar cómo cargar los módulos.'
package.loadlib =
'Enlaza dinámicamente el programa anfitrión con la biblioteca de C `libname`.'
package.path =
'Ruta usada por `require` para buscar por un cargador de Lua.'
package.preload =
'Tabla para almacenar cargadores de módulos específicos.'
package.searchers =
'Una tabla usada por `require` para controlar cómo buscar los módulos.'
package.searchpath =
'Busca por el nombre `name` en la ruta `path`.'
package.seeall =
'Asigna una metatabla para el `module` con su campo `__index` apuntando al ambiente global, de manera que este módulo hereda los valores del ambiente global. Se usa como opción para la función `module` .'
string =
''
string.byte =
'Retorna los códigos numéricos internos de los caracteres `s[i], s[i+1], ..., s[j]`.'
string.char =
'Retorna un string con largo igual al número de argumeentos, en el que cada caracter tiene el código numérico internol igual a su argumento correspondiente.'
string.dump =
'Retorna un string que contiene una representación binaria de la función provista.'
string.find =
'Busca el primer calce del patrón `pattern` (véase §6.4.1) en el string.'
string.format =
'Retorna una versión formateada de su argumentos (en número variable) siguiendo la descripción dada en su primer argumento.'
string.gmatch =
[[
Retorna una función iteradora que cada vez que es llamada retorna las siguientes capturas del patrón `pattern` (véase §6.4.1) sobre el string s.
Por ejemplo, el bucle siguiente itera sobre todas las palabras del sstring s, imprimiendo una por línea:
```lua
s =
"hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gsub =
'Retorna una copia de s en la cual todos (o los primeras `n`, si es provisto este argumento) ocurrencias del patrón `pattern` (vease §6.4.1) han sido reemplazadas por el string de reemplazo especificado por `repl`.'
string.len =
'Retorna el largo.'
string.lower =
'Retorna una copia de este string con todas sus letras mayúsculas cambiadas a minúsculas.'
string.match =
'Busca el primer calce del patrón `pattern` (véase §6.4.1) en el string.'
string.pack =
'Retorna el string binario que contiene los valores `v1`, `v2`, etc. empacados (serializados en forma binaria) de acuerdo al string de formato `fmt` (véase §6.4.2) .'
string.packsize =
'Retorna el largo del string que retorna `string.pack` con el formato `fmt` (véase §6.4.2) provisto.'
string.rep['>5.2'] =
'Retorna el string que es la concatenación de `n` copias del string `s` separado por el string `sep`.'
string.rep['<5.1'] =
'Retorna el string que es la concatenación de `n` copias del string `s` .'
string.reverse =
'Retorna el string que es el string `s` al revés.'
string.sub =
'Retorna el substring del string que empieza en `i` y continúa hasta `j`.'
string.unpack =
'Retorna los valores empacados en el string de acuerdo al string de formato `fmt` (véase §6.4.2) .'
string.upper =
'Retorna una copia de este string con todas sus letras minúsculas cambiadas a mayúsculas.'
table =
''
table.concat =
'Dada una lista donde todos los elementos son strings o números, retorna el string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
table.insert =
'Inserta el elemento `value` en la posición `pos` en la lista `list`.'
table.maxn =
'Retorna el índice numérico positivo más grande de la tabla provista o cero si la tabla no tiene un índice numérico positivo.'
table.move =
[[
Mueve los elementos de la tabla `a1` a la tabla `a2`.
```lua
a2[t],··· =
a1[f],···,a1[e]
return a2
```
]]
table.pack =
'Retorna una nueva tabla con todos los argumentos almacenados en las claves `1`, `2`, etc. y con un campo `"n"` con el número total de argumentos.'
table.remove =
'Remueve de la lista `list`, el elemento en la posición `pos`, retornando el valor del elemento removido.'
table.sort =
'Ordena los elementos de la lista en un orden dado, *modificando la propia lista*, desde `list[1]` hasta `list[#list]`.'
table.unpack =
[[
Retorna los elementos de la lista provista. Esta función es equivalente a
```lua
return list[i], list[i+1], ···, list[j]
```
By default, `i` is `1` and `j` is `#list`.
]]
table.foreach =
'Llama a la función provista f sobre cada uno de los elementos de la tabla. Por cada elemento, f es llamada con el índice y valor respectivo como argumentos. Si f retorna un valor no-nulo, el bucle se termina forzosamente y este valor es retornado como el valor final de foreach.'
table.foreachi =
'Ejecuta la f provista sobre los índices numéricos de la tabla. Por cada índice, f es llamada con el índice y valor respectivo como argumentos. Los índices son visitados en orden secuencial, de 1 a n, donde ne es el tamaño de la tabla. Si f retorna un valor no-nulo, el bucle se termina forzosamente y este valor es retornado como el valor final de foreachi.'
table.getn =
'Retorna el número de elmentos en la tabla. Esta función es equivalente a `#list`.'
table.new =
[[Esta función crea una tabla con el tamaño provisto, como la API en C equivalente `lua_createtable()`. Esta función es útil para tablas grandes si el tamaño final de la tabla es conocido y el agrandar automáticamente la tabla es muy caro. El parámetro `narray` especifica el número de ítemes de tipo de arreglo y el parámetro `nhash` especifica el número de ítemes de tipo diccionario.
```lua
require("table.new")
```
]]
table.clear =
[[Esta función barre con todas las claves y valores de una tabla, pero preserva los tamaños de arreglo/diccionario reservados en memoria. Esta función es útil cuando una tabla que ha sido enlazada desde múltiples otras partes requiere ser vaciada y/o cuando se recicla una tabla para ser usada en el mismo contexto. Esto previene manejar enlaces de vuelta, previene tener que asignar memoria y el costo operativo del crecimiento incremental de la parte arreglo/diccionario.
```lua
require("table.clear").
```
Nótese que esta función está hecha para situaciones muy específicas. En la mayoría de los casos es mejor reemplazar el enlace (el cual suele ser simple) con una tabla nueva y permitir que el recolector de basura haga su trabajo.
]]
utf8 =
''
utf8.char =
'Recibe cero ó más enteros, convierte a cada uno a su secuencia de bytes en UTF-8 correspondiente y retorna un string con la concatenación de todas estas secuencias.'
utf8.charpattern =
'El patrón con el que se calza exactamente una secuencia de bytes en UTF-8, asumiendo que el sujeto es un string en UTF-8 válido.'
utf8.codes =
[[
Retorna valores tal que el constructo
```lua
for p, c in utf8.codes(s) do
body
end
```
itera sobre todos los caracteres en UTF-8 en el string s, con p siendo la posición en bytes y c el punto de código de cada caracter. Alza un error si se encuentra con alguna secuencia inválida de bytes.
]]
utf8.codepoint =
'Retorna los puntos de códigos como enteros de todos los caracteres en `s` que empiezan entre la posición en bytes `i` y `j` (ambos inclusive).'
utf8.len =
'Retorna el número de caracteres en UTF-8 en el string `s` que empiezan entre las posiciones `i` y `j` (ambos inclusive).'
utf8.offset =
'Retorna la posición en bytes donde la codificación del caracter `n`-ésimo de `s` empieza, contado a partir de la posición `i`.'

View File

@@ -0,0 +1,480 @@
---@diagnostic disable: undefined-global
config.addonManager.enable =
"Si el manejador de extensiones está habilitado."
config.addonManager.repositoryBranch =
"Especifica la rama de git usada por el manejador de extensiones."
config.addonManager.repositoryPath =
"Especifica la ruta git usada por el manejador de extensiones."
config.addonRepositoryPath = -- TODO: need translate!
"Specifies the addon repository path (not related to the addon manager)."
config.runtime.version =
"Versión de Lua que se ejecuta."
config.runtime.path =
[[
Cuando se ocupa un `require`, cómo se encuentra el archivo basado en el nombre de entrada.
Asignar esta configuración a `?/init.lua` significa que cuando se ingresa `require 'myfile'` se busca en `${workspace}/myfile/init.lua` desde los archivos cargados.
Si `runtime.pathStrict` es `false`, también se busca en `${workspace}/**/myfile/init.lua`.
Si se desea cargar archivos fuera del espacio de trabajo, se debe asignar `Lua.workspace.library` primero.
]]
config.runtime.pathStrict =
'Cuando está habilitado, `runtime.path` sólo buscará en el primer nivel de directorios, vea la descripción de `runtime.path`.'
config.runtime.special =
[[Las variables globales personalizadas son consideradas variables intrínsecas, y el servidor de lenguage proveerá un soporte especial.
El siguiente ejemplo muestra que 'include' es tratado como 'require'.
```json
"Lua.runtime.special" : {
"include" : "require"
}
```
]]
config.runtime.unicodeName =
"Se permiten los caracteres unicode en los nombres."
config.runtime.nonstandardSymbol =
"Soporte de símbolos no estándar. Asegúrese que la versión de Lua que se ejecuta soporte estos símbolos."
config.runtime.plugin =
"Ruta de plugin. Revise [la wiki](https://luals.github.io/wiki/plugins) para más información."
config.runtime.pluginArgs =
"Argumentos adicionals al plugin."
config.runtime.fileEncoding =
"Codificación de archivo. La opción `ansi` solo está disponible en la plataforma `Windows`."
config.runtime.builtin =
[[
Ajuste de la habilitación de biblioteca interna provista. Puede deshabilitar (o redefinir) las bibliotecas inexistentes de acuerdo al ambiente de ejecución.
* `default`: Indica que la biblioteca será habilitada o deshabilitada de acuerdo a la versión que se ejecuta.
* `enable`: Habilitada
* `disable`: Deshabilitada
]]
config.runtime.meta =
'Formato del nombre del directoria de los archivos meta.'
config.diagnostics.enable =
"Habilita los diagnósticos."
config.diagnostics.disable =
"Deshabilita los diagnósticos (Usa código en corchetes bajo el cursor)."
config.diagnostics.globals =
"Variables globales definidas."
config.diagnostics.globalsRegex =
"Encuentra variables globales definidas usando esta expresión regular."
config.diagnostics.severity =
[[
Modifica el la severirad de los diagnósticos.
Agregue `!` al final para descartar la configuración `diagnostics.groupSeverity`.
]]
config.diagnostics.neededFileStatus =
[[
* Opened: Solo diagnostica los archivos abiertos
* Any: diagnostica todos los archivos
* None: deshabilita este diagnóstico
Agregue `!` al final para descartar la configuración `diagnostics.groupFileStatus`.
]]
config.diagnostics.groupSeverity =
[[
Modifica el la severirad de los diagnósticos en un grupo.
`Fallback` significa que los diagnósticos en este grupo son controlados con una severida separada de `diagnostics.severity`.
Otras configuraciones descartan las configuraciones individuales que no terminen en `!`.
]]
config.diagnostics.groupFileStatus =
[[
Modifica los diagnósticos de archivos requeridos en un grupo.
* Opened: solo diagnostica los archivos abiertos
* Any: diagnostica todos los archivos
* None: deshabilita este diagnóstico
`Fallback` significa que los diagnósticos en este grupo son controlados con una severida separada de `diagnostics.neededFileStatus`.
Otras configuraciones descartan las configuraciones individuales que no terminen en `!`.
]]
config.diagnostics.workspaceEvent =
"Fija el tiempo para lanzar los diagnósticos del espacio de trabajo."
config.diagnostics.workspaceEvent.OnChange =
"Lanza los diagnósticos del espacio de trabajo cuando se cambie el archivo."
config.diagnostics.workspaceEvent.OnSave =
"Lanza los diagnósticos del espacio de trabajo cuando se guarde el archivo."
config.diagnostics.workspaceEvent.None =
"Deshabilita los diagnósticos del espacio de trabajo."
config.diagnostics.workspaceDelay =
"Latencia en milisegundos para diagnósticos del espacio de trabajo."
config.diagnostics.workspaceRate =
"Tasa porcentual de diagnósticos del espacio de trabajo. Decremente este valor para reducir el uso de CPU, también reduciendo la velocidad de los diagnósticos del espacio de trabajo. El diagnóstico del archivo que esté editando siempre se hace a toda velocidad y no es afectado por esta configuración."
config.diagnostics.libraryFiles =
"Cómo diagnosticar los archivos cargados via `Lua.workspace.library`."
config.diagnostics.libraryFiles.Enable =
"Estos archivos siempre se diagnostican."
config.diagnostics.libraryFiles.Opened =
"Estos archivos se diagnostican solo cuando se abren."
config.diagnostics.libraryFiles.Disable =
"Estos archivos no se diagnostican."
config.diagnostics.ignoredFiles =
"Cómo diagnosticar los archivos ignorados."
config.diagnostics.ignoredFiles.Enable =
"Estos archivos siempre se diagnostican."
config.diagnostics.ignoredFiles.Opened =
"Estos archivos se diagnostican solo cuando se abren."
config.diagnostics.ignoredFiles.Disable =
"Estos archivos no se diagnostican."
config.diagnostics.disableScheme =
'Los archivos de Lua que siguen el siguiente esquema no se diagnostican.'
config.diagnostics.unusedLocalExclude =
'Las variables que calcen con el siguiente patrón no se diagnostican con `unused-local`.'
config.workspace.ignoreDir =
"Directorios y archivos ignorados (se usa la misma gramática que en `.gitignore`)"
config.workspace.ignoreSubmodules =
"Ignora submódulos."
config.workspace.useGitIgnore =
"Ignora los archivos enlistados en `gitignore` ."
config.workspace.maxPreload =
"Máxima pre-carga de archivos."
config.workspace.preloadFileSize =
"Cuando se pre-carga, se omiten los archivos más grandes que este valor (en KB)."
config.workspace.library =
"Además de los del espacio de trabajo actual, se cargan archivos de estos directorios. Los archivos en estos directorios serán tratados como bibliotecas con código externo y algunas características (como renombrar campos) no modificarán estos archivos."
config.workspace.checkThirdParty =
[[
Detección y adaptación automática de bibliotecas externas. Actualmente soportadas:
* OpenResty
* Cocos4.0
* LÖVE
* LÖVR
* skynet
* Jass
]]
config.workspace.userThirdParty =
'Rutas archivos de configuración para bibliotecas externas privadas. Revise [el archivo de configuración](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd) provisto.'
config.workspace.supportScheme =
'El servidor de lenguage será provisto para los archivos de Lua del siguiente esquema.'
config.completion.enable =
'Habilita la completación.'
config.completion.callSnippet =
'Muestra snippets para llamadas de funciones.'
config.completion.callSnippet.Disable =
"Solo muestra `función nombre`."
config.completion.callSnippet.Both =
"Muestra `función nombre` y `llamar al snippet`."
config.completion.callSnippet.Replace =
"Solo muestra `llamar al snippet`."
config.completion.keywordSnippet =
'Muestra snippets con sintaxis de palabras clave.'
config.completion.keywordSnippet.Disable =
"Solo muestra `palabra clave`."
config.completion.keywordSnippet.Both =
"Muestra `palabra clave` y `snippet de sintaxis`."
config.completion.keywordSnippet.Replace =
"Solo muestra `snippet de sintaxis`."
config.completion.displayContext =
"La prevista de la sugerencia del snippet de código relevante ayuda a entender el uso de la sugerenecia. El número fijado indica el número de líneas interceptadas en el fragmento de código. Fijando en `0` se deshabilita esta característica."
config.completion.workspaceWord =
"Si es que el la palabra contextual presentada contiene contenido de otros archivos en el espacio de trabajo."
config.completion.showWord =
"Muestra palabras contextuales en las sugerencias."
config.completion.showWord.Enable =
"Siempre muestra palabras contextuales en las sugerencias."
config.completion.showWord.Fallback =
"Las palabras contextuales solo se muestran si las sugerencias basadas en la semántica no están provistas."
config.completion.showWord.Disable =
"Sin presentar las palabras contextuales."
config.completion.autoRequire =
"Agrega automáticamente el `require` correspondiente cuando la entrada se parece a un nombre de archivo."
config.completion.showParams =
"Muestra los parámetros en la lista de completado. Cuando la función tiene múltiples definiciones, se mostrarán por separado."
config.completion.requireSeparator =
"Separador usado en `require`."
config.completion.postfix =
"El símbolo usado para lanzar la sugerencia posfija."
config.color.mode =
"Modo de coloración."
config.color.mode.Semantic =
"Coloración semántica. Puede ser necesario asignar `editor.semanticHighlighting.enabled` a `true` para que tenga efecto."
config.color.mode.SemanticEnhanced =
"Coloración de semántica avanzada. Igual que `Semántica`, pero con análisis adicional que hace que se requira computación más cara."
config.color.mode.Grammar =
"Coloración de la gramática."
config.semantic.enable =
"Habilita la coloración semántica. Puede ser necesario asignar `editor.semanticHighlighting.enabled` a `true` para que tenga efecto."
config.semantic.variable =
"Coloración semántica de variables, campos y parámetros."
config.semantic.annotation =
"Coloración de las anotaciones de tipo."
config.semantic.keyword =
"Coloración semántica de palabras clave, literales y operadores. Se necesita habilitar esta característica si su editor no puede hacer coloración sintáctica."
config.signatureHelp.enable =
"Habilita la ayuda de firma."
config.hover.enable =
"Habilita la información bajo el cursor."
config.hover.viewString =
"Ubica el cursor bajo un string para ver su contenido (solo si el literal contiene un caracter de escape)."
config.hover.viewStringMax =
"Largo máximo de la información bajo el cursor para ver el contenido de un string."
config.hover.viewNumber =
"Ubica el cursor para ver el contenido numérico (solo si el literal no es decimal)."
config.hover.fieldInfer =
"Cuando se ubica el cursor para ver una tabla, la inferencia de tipo se realizará para cada campo. Cuando el tiempo acumulado de la inferencia de tipo alcanza el valor fijado (en MS), la inferencia de tipo para los campos subsecuentes será omitida."
config.hover.previewFields =
"Cuando se ubica el cursor para ver una tabla, fija el máximo numero de previstas para los campos."
config.hover.enumsLimit =
"Cuando el valor corresponde a múltiples tipos, fija el límite de tipos en despliegue."
config.hover.expandAlias =
[[
Expandir o no los alias. Por ejemplo, la expansión de `---@alias miTipo boolean|number` aparece como `boolean|number`, caso contrarior, aparece como `miTipo`.
]]
config.develop.enable =
'Modo de desarrollador. No debe habilitarlo, el rendimiento se verá afectado.'
config.develop.debuggerPort =
'Puerto en que el depurador escucha.'
config.develop.debuggerWait =
'Suspender después de que el depurador se conecte.'
config.intelliSense.searchDepth =
'Fija la profundidad de búsqueda para IntelliSense. El incrementar este valor aumenta la precisión, pero empeora el rendimiento. Diferentes espacios de trabajo tienen diferente tolerancia para esta configuración. Ajústese al valor apropiado.'
config.intelliSense.fastGlobal =
'En la completación de variable global, y entrada de suspensión de vista `_G`. Esto reduce levemente la precisión de la especulación de tipo, pero tiene una mejora de rendimiento notable para proyectos que ocupan harto las variables globales.'
config.window.statusBar =
'Muestra el estado de la extensión en la barra de estado.'
config.window.progressBar =
'Muestra la barra de progreso en la barra de estado.'
config.hint.enable =
'Habilita pistas en línea.'
config.hint.paramType =
'Muestra las pistas de tipo al parámetro de las funciones.'
config.hint.setType =
'Muestra las pistas de tipo en las asignación.'
config.hint.paramName =
'Muestra las pistas de tipo en las llamadas a funciones.'
config.hint.paramName.All =
'Se muestran odos los tipos de los parámetros.'
config.hint.paramName.Literal =
'Se muestran solo los parámetros de tipos literales.'
config.hint.paramName.Disable =
'Deshabilita las pistas de los parámetros.'
config.hint.arrayIndex =
'Muestra las pistas de los índices de arreglos cuando se construye una tabla.'
config.hint.arrayIndex.Enable =
'Muestra las pistas en todas las tablas.'
config.hint.arrayIndex.Auto =
'Muestra las pistas solo cuando la tabla tiene más de 3 ítemes, o cuando la tabla es mixta.'
config.hint.arrayIndex.Disable =
'Deshabilita las pistas en de los índices de arreglos.'
config.hint.await =
'Si la función que se llama está marcada con `---@async`, pregunta por un `await` en la llamada.'
config.hint.semicolon =
'Si no hay punto y coma al final de la sentencia, despliega un punto y coma virtual.'
config.hint.semicolon.All =
'Todas las sentencias con un punto y coma virtual desplegado.'
config.hint.semicolon.SameLine =
'Cuando dos sentencias están en la misma línea, despliega un punto y coma entre ellas.'
config.hint.semicolon.Disable =
'Deshabilita punto y coma virtuales.'
config.codeLens.enable =
'Habilita el lente para código.'
config.format.enable =
'Habilita el formateador de código.'
config.format.defaultConfig =
[[
La configuración de formateo predeterminada. Tiene menor prioridad que el archivo `.editorconfig`
en el espacio de trabajo.
Revise [la documentación del formateador](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)
para aprender más sobre su uso.
]]
config.spell.dict =
'Palabras extra para el corrector ortográfico.'
config.nameStyle.config =
[[
Configuración de estilo para nombres.
Revise [la documentación del formateador](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)
para aprender más sobre su uso.
]]
config.telemetry.enable =
[[
Habilita la telemetría para enviar información del editor y registros de errores por la red. Lea nuestra política de privacidad [aquí (en inglés)](https://luals.github.io/privacy#language-server).
]]
config.misc.parameters =
'[Parámetros de la línea de comando](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) para iniciar el servidor de lenguage en VSCode.'
config.misc.executablePath =
'Especifica la ruta del ejecutable en VSCode.'
config.language.fixIndent =
'(Solo en VSCode) Arregla la auto-indentación incorrecta, como aquella cuando los quiebres de línea ocurren dentro de un string que contengan la palabra "function".'
config.language.completeAnnotation =
'(Solo en VSCode) Inserta automáticamente un "---@ " después de un quiebre de línea que sucede a una anotación.'
config.type.castNumberToInteger =
'Se permite asignar el tipo "número" al tipo "entero".'
config.type.weakUnionCheck =
[[
Una vez que un sub-tipo de un tipo de unión satisface la condición, el tipo de unión también satisface la condición.
Cuando esta configuración es `false`, el tipo `number|boolean` no puede ser asignado al tipo `number`. Solo se puede con `true`.
]]
config.type.weakNilCheck =
[[
Cuando se revisa el tipo de un tipo de unión, los `nil` dentro son ignorados.
Cuando esta configuración es `false`, el tipo `number|nil` no puede ser asignado al tipo `number`. Solo se puede con `true`.
]]
config.type.inferParamType =
[[
Cuando un tipo de parámetro no está anotado, se infiere su tipo de los lugares donde la función es llamada.
Cuando esta configuración es `false`, el tipo del parámetro `any` cuando no puede ser anotado.
]]
config.type.checkTableShape =
[[
Chequea estrictamente la forma de la tabla.
]]
config.type.inferTableSize = -- TODO: need translate!
'Maximum number of table fields analyzed during type inference.'
config.doc.privateName =
'Trata los nombres específicos de campo como privados. Por ejemplo `m_*` significa `XXX.m_id` y `XXX.m_tipo` son privados, por lo que solo pueden ser accedidos donde se define la clase.'
config.doc.protectedName =
'Trata los nombres específicos de campo como protegidos. Por ejemplo `m_*` significa `XXX.m_id` y `XXX.m_tipo` son privados, por lo que solo pueden ser accedidos donde se define la clase y sus subclases.'
config.doc.packageName =
'Trata los nombres específicos de campo como del paquete. Por ejemplo `m_*` significa `XXX.m_id` y `XXX.m_tipo` son de paquete, por lo que solo pueden ser accedidos en el archivo donde son definidos.'
config.doc.regengine = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.doc.regengine.glob = -- TODO: need translate!
'The default lightweight pattern syntax.'
config.doc.regengine.lua = -- TODO: need translate!
'Full Lua-style regular expressions.'
config.docScriptPath = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.diagnostics['unused-local'] =
'Habilita el diagnóstico de variables local sin uso.'
config.diagnostics['unused-function'] =
'Habilita el diagnóstico funcines sin uso.'
config.diagnostics['undefined-global'] =
'Habilita el diagnóstico de variables globales sin definir.'
config.diagnostics['global-in-nil-env'] =
'Habilita el diagnóstico para la prohibición de uso de variables globales (`_ENV` se fija a `nil`).'
config.diagnostics['unused-label'] =
'Habilita el diagnóstico de etiquetas sin uso.'
config.diagnostics['unused-vararg'] =
'Habilita el diagnóstico de expresión de número variable de argumentos (vararg) sin uso.'
config.diagnostics['trailing-space'] =
'Habilita el diagnóstico de espacios al final de línea.'
config.diagnostics['redefined-local'] =
'Habilita el diagnóstico de variables locals redefinidas.'
config.diagnostics['newline-call'] =
'Habilita el diagnóstico de llamadas en línea nueva. Se alza un error en las líneas que comienzan con `(`, lo que se lee sintácticamente como una llamada a la línea anterior.'
config.diagnostics['newfield-call'] =
'Habilita el diagnóstico de campo nuevo en una llamada. Se alza un error cuando los paréntesis de una llamada a una función aparecen en la siguiente línea cuando se define un campo en una tabla.'
config.diagnostics['redundant-parameter'] =
'Habilita el diagnóstico de parámetros redundantes de una función.'
config.diagnostics['ambiguity-1'] =
'Habilita el diagnóstico de precedencia de operadores ambiguos. Por ejemplo, ante la expresión `num or 0 + 1` se sugerirrá `(num or 0) + 1`.'
config.diagnostics['lowercase-global'] =
'Habilita el diagnóstico de definiciones de variables globacels con minúsculas.'
config.diagnostics['undefined-env-child'] =
'Habilita el diagnóstico de variables de ambientes sin definir. Se alza un error cuando a la tabla `_ENV` se le asigna una tabla literal nueva, pero la variable global usada no está presente en el ambiente global.'
config.diagnostics['duplicate-index'] =
'Habilita el diagnóstico de índices de tabla duplicados.'
config.diagnostics['empty-block'] =
'Habilita el diagnóstico de bloques de código vacíos.'
config.diagnostics['redundant-value'] =
'Habilita el diagnóstico de valores asignados redundantemente. Se alza un error en una asignación, cuando el número de valores es mayor que el número de objetos a los cuales se les asigna.'
config.diagnostics['assign-type-mismatch'] =
'Habilita el diagnóstico para asignaciones en las cuales el valor del tipo no calza con el tipo de la variable siendo asignada.'
config.diagnostics['await-in-sync'] =
'Habilita el diagnóstico para llamadas a funciones asíncronas dentro de una función síncrona.'
config.diagnostics['cast-local-type'] =
'Habilita el diagnóstico para conversión de tipos de variables locales donde el tipo objetivo no calza con el tipo definido.'
config.diagnostics['cast-type-mismatch'] =
'Habilita el diagnóstico para conversiones de tipos donde el tipo objetivo no calza con el tipo inicial.'
config.diagnostics['circular-doc-class'] =
'Habilita el diagnóstico para pares de clases que heredan una de la otra, introduciendo una relación circular.'
config.diagnostics['close-non-object'] =
'Habilita el diagnóstico para intentos de cerra una variable con un no-objeto.'
config.diagnostics['code-after-break'] =
'Habilita el diagnóstico para el código que viene después de un `break` en un bucle.'
config.diagnostics['codestyle-check'] =
'Habilita el diagnóstico para líneas formateadas incorrectamente.'
config.diagnostics['count-down-loop'] =
'Habilita el diagnóstico para bucles `for` en los cuales nunca se alcanza su máximo o límite por que el bucle es incremental en vez de decremental.'
config.diagnostics['deprecated'] =
'Habilita el diagnóstico para resaltar APIs obsoletas.'
config.diagnostics['different-requires'] =
'Habilita el diagnóstico para archivos que son requeridos con dos rutas distintas.'
config.diagnostics['discard-returns'] =
'Habilita el diagnóstico para llamadas de funciones anotadas con `---@nodiscard` en las cuales se ignore los valores retornados.'
config.diagnostics['doc-field-no-class'] =
'Habilita el diagnóstico para resaltar una anotación de campo sin una anotación de clase que lo defina.'
config.diagnostics['duplicate-doc-alias'] =
'Habilita el diagnóstico para nombres de alias duplicados en una anotación.'
config.diagnostics['duplicate-doc-field'] =
'Habilita el diagnóstico para nombres de campo duplicados en una anotación.'
config.diagnostics['duplicate-doc-param'] =
'Habilita el diagnóstico para nombres de parámetros duplicados en una anotación.'
config.diagnostics['duplicate-set-field'] =
'Habilita el diagnóstico para cuando se asigna el mismo campo en una clase más de una vez.'
config.diagnostics['incomplete-signature-doc'] =
'Habilita el diagnóstico para anotaciones @param o @return incompletas para funciones.'
config.diagnostics['invisible'] =
'Habilita el diagnóstico para accesos a campos que son invisibles.'
config.diagnostics['missing-global-doc'] =
'Habilita el diagnóstico para globales faltantes. Las funciones globales deben tener un comentario y anotaciones para todos sus parámetros y valores retornados.'
config.diagnostics['missing-local-export-doc'] =
'Habilita el diagnóstico para locales exportadas. Las funciones locales deben tener un comentario y anotaciones para todos sus parámetros y valores retornados.'
config.diagnostics['missing-parameter'] =
'Habilita el diagnóstico para llamados de funciones donde el número de argumentos es menore que el número de parámetros anotados de la función.'
config.diagnostics['missing-return'] =
'Habilita el diagnóstico para para funciones con anotaciones de retorno que no tienen la expresión `return …`.'
config.diagnostics['missing-return-value'] =
'Habilita el diagnóstico para expresiones `return …` sin valores aunque la función que la contiene declare retornos.'
config.diagnostics['need-check-nil'] =
'Habilita el diagnóstico para usos de variables si `nil` o un valor opcional (potencialmente `nil`) haya sido asignado a la variable anteriormente.'
config.diagnostics['no-unknown'] =
'Habilita el diagnóstico para los casos en que el tipo no puede ser inferido.'
config.diagnostics['not-yieldable'] =
'Habilita el diagnóstico para llamadas a `coroutine.yield()` cuando no esté permitido.'
config.diagnostics['param-type-mismatch'] =
'Habilita el diagnóstico para llamadas a funciones donde el tipo de un parámetro provisto no calza con el tipo de la definición anotado de la función.'
config.diagnostics['redundant-return'] =
'Habilita el diagnóstico para sentencias de retorno que no son necesarias porque la función terminaría de igual manera.'
config.diagnostics['redundant-return-value']=
'Habilita el diagnóstico para sentencias de retorno que retornan un valor extra que no fue especificado por una anotación de retorno.'
config.diagnostics['return-type-mismatch'] =
'Habilita el diagnóstico para valores retornados cuyo tipo no calza con el tipo declarado en la anotación correspondiente de la función.'
config.diagnostics['spell-check'] =
'Habilita el diagnóstico para errores tipográficos en strings.'
config.diagnostics['name-style-check'] =
'Habilita el diagnóstico para el estilo de nombres.'
config.diagnostics['unbalanced-assignments']=
'Habilita el diagnóstico para asignaciones múltiplies si no todas las variables obtienen un valor (por ejemplo, `local x,y = 1`).'
config.diagnostics['undefined-doc-class'] =
'Habilita el diagnóstico para las anotaciones de clase en las cuales una clase sin definir es referenciada.'
config.diagnostics['undefined-doc-name'] =
'Habilita el diagnóstico para anotaciones de tipo que referencian a un tipo o alias sin definir.'
config.diagnostics['undefined-doc-param'] =
'Habilita el diagnóstico para casos en que una anotación de parámetro es dado sin declarar el parámetro en la definición de la función.'
config.diagnostics['undefined-field'] =
'Habilita el diagnóstico para los casos en que se lee un campo sin definir de una variable.'
config.diagnostics['unknown-cast-variable'] =
'Habilita el diagnóstico para conversiones de tipo de variables sin definir.'
config.diagnostics['unknown-diag-code'] =
'Habilita el diagnóstico para los casos en que un código desconocido de diagnóstico es ingresado.'
config.diagnostics['unknown-operator'] =
'Habilita el diagnóstico para operadores desconocidos.'
config.diagnostics['unreachable-code'] =
'Habilita el diagnóstico para código inalcanzable.'
config.diagnostics['global-element'] =
'Habilita el diagnóstico que alerta sobre elementos globales.'
config.typeFormat.config =
'Configura el comportamiento del formateo mientras se tipea código Lua.'
config.typeFormat.config.auto_complete_end =
'Controla si se completa automáticamente con `end` en las posiciones correspondientes.'
config.typeFormat.config.auto_complete_table_sep =
'Controla si se agrega automáticamente un separador al final de la declaración de una tabla.'
config.typeFormat.config.format_line =
'Controla si una línea se formatea'
command.exportDocument =
'Lua: Exporta Documento ...'
command.addon_manager.open =
'Lua: Abre el Manejador de Extensiones ...'
command.reloadFFIMeta =
'Lua: Recarga meta de ffi para luajit'
command.startServer =
'Lua: (debug) Carga el Servidor de Lenguaje'
command.stopServer =
'Lua: (debug) Detén el Servidor de Lenguaje'

View File

@@ -0,0 +1,761 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
'LUAスタンドアローンに渡す引数'
assert =
'引数 v が偽i.e., `nil` または `false`)の場合、エラーを発生させる。それ以外の場合は、すべての引数を返えす。エラーが発生した際、`message` がエラーオブジェクトになる。`message` が指定されていない場合、デフォルトでエラーオブジェクトが `"assertion failed!"` になる。'
cgopt.collect =
'完全なガベージコレクションサイクルを実行する。'
cgopt.stop =
'自動実行を停止する。'
cgopt.restart =
'自動実行を再開する。'
cgopt.count =
'利用されているメモリ量の合計をキロバイト単位で返す。'
cgopt.step =
'ガベージコレクションのステップを実行する。'
cgopt.setpause =
'`pause` の値を設定する。'
cgopt.setstepmul =
'`step multiplier` の値を設定する。'
cgopt.incremental =
'ガベージコレクションのモードをインクリメンタルに変更する。'
cgopt.generational =
'ガベージコレクションのモードを世代別に変更する。'
cgopt.isrunning =
'ガベージコレクションが実行中かどうかを返す。'
collectgarbage =
'この関数はガベージコレクション機能への汎用的なインターフェース。第一引数 `opt` に応じて異なる操作を実行する。'
dofile =
'指定されたファイルを開き、その内容をLuaチャンクとして実行する。引数が指定されなかった場合、標準入力`stdin`)の内容を実行する。チャンクによって返されたすべての値を返す。エラーが発生した場合、そのエラーが呼び出し元まで伝播される(つまり、`dofile` は保護モードでは実行されない)。'
error =
[[
最後に実行された保護関数を終了させ、`message` をエラーオブジェクトとして返す。
一般的には、`message` が文字列だった場合にエラーの発生位置に関する情報がその先端に追加される。
]]
_G =
'グローバル環境を保持するグローバル変数関数ではない。Lua自体がこの変数を使用しないため、その値を変更しても環境には影響しないし、その逆も同様である。より詳細な説明には§2.2を参照。'
getfenv =
'関数 `f` が現在使用している環境を返す。`f` はLua関数、またはスタックレベルを指定する数字である。'
getmetatable =
'`object` にメタテーブルがない場合、nil を返す。メタテーブルがありそこに "__metatable" フィールドがある場合、その値を返す。 それ以外の場合、メタテーブル自身を返す。' -- TODO
ipairs =
[[
三つの値(イテレータ関数、テーブル `t` 、そして `0`)を返す。三つの値は次の構文
```lua
for i,v in ipairs(t) do body end
```
において `i,v` が `(1,t[1]), (2,t[2]), ...` となるように設定される。
]]
loadmode.b =
'バイナリチャンクのみ。'
loadmode.t =
'テキストチャンクのみ。'
loadmode.bt =
'バイナリとテキストの両方。'
load['<5.1'] =
'`func` を繰り返して呼び出すことによってチャンクを取得し、それをロードする。`func` は文字列を返す必要があり、それらの結果を結合したものがチャンクの値となる。'
load['>5.2'] =
[[
チャンクをロードする。
`chunk`が文字列の場合、チャンクがその文字列となる。`chunk` が関数の場合、その関数を繰り返して呼び出した結果ががチャンクの値となる。`chunk` への各呼び出しは以前の結果と結合される文字列か、反復の終了を指す空の文字列、nil、または空の値を返す必要がある。
]]
loadfile =
'ファイル`filename` を一つのチャンクとしてロードする。`filename` が指定されていない場合、標準入力からチャンクをロードする。'
loadstring =
'指定された文字列からチャンクをロードする。'
module =
'モジュールを作成する。'
next =
[[
テーブル内のすべてのフィールドを走査するための関数。
走査対象のテーブルと現在の走査位置を示すキーをを引数に取り、次のキーとそれに関連されている値を返す。次のキーがない場合には `nil` を返す。走査位置が `nil` の場合、テーブルの最初のキーとその値を返す。
`next`の走査順は不定。数値をキーとして持つテーブルを数値順で走査したい場合には `for` をご利用ください。
走査中に存在しないフィールドに値を設定した場合、`next` の動作は未定義。ただし、既存のフィールドを変更することは可能。特に、既存のフィールドを `nil` に設定することも可能。
]]
pairs =
[[
テーブル `t` に `__pairs` のメタメソッドがある場合、それを `t` で呼び出された場合の戻り値を返す。
それ以外の場合、三つの値(イテレータ関数、テーブル `t` 、そして `nil`)を返す。三つの値は次の構文
```lua
for k,v in pairs(t) do body end
```
において `k,v` が `t` 内のそれぞれのキーと値となるように設定される。
走査中にテーブルを変更するリスクについては、$next の説明を参照。
]]
pcall =
[[
'保護モードで関数 `f` を指定された引数で呼び出す。
保護モードでは、実行中に発生したエラーがキャッチされ、状態コードとして返される。
`pcall`の最初の戻り値は状態コードを表すブール値。エラーなく関数の実行に成功した場合、状態コードは `true` でその後にすべての呼び出し結果を返す。エラーが発生した場合、状態コードは `false` でその後にエラーオブジェクトが返戻される。
]]
print =
[[
任意数の引数を受け取り、それらを文字列に変換した後 `stdout` に出力する。文字列への変換は $tostring と同様な手順で行われる。
デバッグなどに置ける簡易的な値の確認を主な用途としているため、引数のフォーマッティングは指定できない。出力文字列のより細かな制御を行いたい場合には $string.format か $io.write をご利用ください。
]]
rawequal =
'`v1` が `v2` と等しいかどうかを確認する。メタメソッド `__eq` が定義されていても、それを無視する。'
rawget =
'`table[index]` の値を取得する。メタメソッド `__index` が定義されていても、それを無視する。'
rawlen =
'オブジェクト `v` の長さを取得する。メタメソッド `__len` が定義されていても、それを無視する。'
rawset =
[[
`table[index]` を `value` に設定し、`table` を返す。メタメソッド `__newindex` が定義されていても、それを無視する。
`table`はテーブル型、`index` は `nil` と `NaN` 以外の値である必要がある。
]]
select =
[[
`index` が数字の場合、`select` に指定された `index` 番目以降の引数すべて返す。`index` が負の数値の場合には、最後の引数から数えられる(例えば、`-1` は最後の引数を指す)。
それ以外の場合、`index` は文字列 `"#"` である必要があり、`index` 以降の全引数の数を返す。
]]
setfenv =
'指定された関数に使用される環境を設定する。'
setmetatable =
[[
指定されたテーブルのメタテーブルを設定し、テーブルを返す。`metatable` が `nil` の場合、指定されたテーブルのメタテーブルを除去する。元のメタテーブルに `__metatable` フィールドがある場合、エラーを発生させる。
テーブル以外のオブジェクトのメタテーブルを変更するには、`debug` ライブラリを利用する必要がある (§6.10)。
]]
tonumber =
[[
`base`が指定されていない場合、引数を数値に変換しようとする。引数がすでに数値か、数値に変換可能な文字列であれば、その数値を返す。それ以外の場合は `fail` を返す。
文字列からの変換の際、結果は整数、または浮動小数点数になる可能性がある§3.1参照)。変換前の文字列は先頭と末尾にスペースや、符号を含むことができる。
]]
tostring =
[[
任意の値を可読な文字列に変換する。
`v` のメタテーブルに `__tostring` フィールドがある場合、そのフィールドに格納されている関数を引数 `v` で呼び出し、その結果を返す。それ以外の場合、`v` のメタテーブルに `__name` というフィールドがあり、そのフィールドに文字列が格納されている場合、その文字列が結果に利用される可能性がある。
数値の変換を制御するには、$string.format を使用する。
]]
type =
[[
引数の型を文字列として返す。可能な戻り値は`"nil"`, `"number"`, `"string"`, `"boolean"`, `"table"`, `"function"`, `"thread"`, と `"userdata"`.
]]
_VERSION =
'実行中のLuaバージョンを表す文字列を保持するグローバル変数関数ではない'
warn =
'警告を発する。警告のメッセージは `warn` 関数に渡されたすべての引数を結合した文字列。`warn` に渡されるすべての引数が文字列である必要がある。'
xpcall['=5.1'] =
'新規メッセージハンドラ `err` を設定した上で、関数 `f` を指定された引数で保護モードで実行する。'
xpcall['>5.2'] =
'新規メッセージハンドラ `msgh` を設定した上で、関数 `f` を指定された引数で保護モードで実行する。'
unpack =
[[
`list`の各要素を返す。この関数は下記文と同等に機能する。
```lua
return list[i], list[i+1], ···, list[j]
```
]]
bit32 =
''
bit32.arshift =
[[
数値 `x` を `disp` ビットだけ右にシフトした値を返す。`disp` が負の場合、左にシフトする。
シフト操作中、左に空いたビットは `x` の最上位ビットのコピーで埋められ、右に空いたビットはゼロで埋められるライブラリ (arithmetic shift)。
]]
bit32.band =
'オペランドのビット単位ANDを返す。'
bit32.bnot =
[[
`x`のビット単位NOTを返す。
```lua
assert(bit32.bnot(x) ==
(-1 - x) % 2^32)
```
]]
bit32.bor =
'オペランドのビット単位ORを返す。'
bit32.btest =
'オペランドのビット単位ANDがゼロと異なるかどうかのブール値を返す。'
bit32.bxor =
'オペランドのビット単位XORを返す。'
bit32.extract =
'数値 `n` のビット `field` から`field + width - 1`を符号なし整数として返す。'
bit32.replace =
'数値 `n` のビット `field` から `field + width - 1` を `v` で置き換えた数値を返す。'
bit32.lrotate =
'数値 `x` を `disp` ビットだけ左に回転した値を返す。`disp` が負の場合、右に回転する。'
bit32.lshift =
[[
数値 `x` を `disp` ビットだけ左にシフトした値を返す。`disp` が負の場合、右にシフトする。シフトの方向に関わらず、空いたビットはゼロで埋められる。
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
bit32.rrotate =
'数値 `x` を `disp` ビットだけ右に回転した値を返す。`disp` が負の場合、左に回転する。'
bit32.rshift =
[[
数値 `x` を `disp` ビットだけ右にシフトした値を返す。`disp` が負の場合、左にシフトする。シフトの方向に関わらず、空いたビットはゼロで埋められる。
```lua
assert(bit32.rshift(b, disp) ==
math.floor(b % 2^32 / 2^disp))
```
]]
coroutine =
''
coroutine.create =
'`f` をボディに持つ新しいコルーチンを作成し、それを返す。`f` は関数である必要がある。返されるオブジェクトの型は "thread" である。'
coroutine.isyieldable =
'実行中のコルーチンがyieldできるかどうかを返す。'
coroutine.isyieldable['>5.4']=
'コルーチン `co` がyieldできるかどうかを返す。`co` が指定されていない場合、実行中のコルーチンに対して評価する。'
coroutine.close =
'コルーチン `co` をクローズする: 保留中の変数をすべてクローズし、`co` の状態を `dead` にする。'
coroutine.resume =
'コルーチン `co` の実行を開始、あるいは再開する。'
coroutine.running =
'実行中のコルーチンと、実行中のコルーチンがメインのコルーチンであるかどうかのブール値を返す。'
coroutine.status =
'コルーチン `co` の状況を表す文字列を返す。'
coroutine.wrap =
'`f` をボディに持つ新しいコルーチンを作成し、呼び出される度にそのコルーチンを再開する関数を返す。`f` は関数である必要がある。'
coroutine.yield =
'実行中のコルーチンを一時停止する。'
costatus.running =
'実行中。'
costatus.suspended =
'一時停止、または開始されていない。'
costatus.normal =
'有効かされているが、実行されていない。'
costatus.dead =
'実行が終了したか、エラーによって中断された。'
debug =
''
debug.debug =
'ユーザー入力を順次に実行するインタラクティブモードに入る。contを入力するとインタラクティブモードの実行が中断される。'
debug.getfenv =
'オブジェクト `o` の環境を返す。'
debug.gethook =
'スレッドの現在のフック設定を返す。現在のフック関数、現在のフックマスク、現在のフックカウントの3つの値が返される。'
debug.getinfo =
'関数に関する情報を持つテーブルを返す。'
debug.getlocal['<5.1'] =
'スタックのレベル `level` にある関数のインデックスが `local` のローカル変数に対して、その名前と値を返す。'
debug.getlocal['>5.2'] =
'スタックのレベル `f` にある関数のインデックスが `local` のローカル変数に対して、その名前と値を返す。'
debug.getmetatable =
'指定された値のメタテーブルを返す。'
debug.getregistry =
'レジストリテーブルを返す。'
debug.getupvalue =
'関数 `f` のインデックスが `up` のアップバリューに対して、その名前と値を返す。'
debug.getuservalue['<5.3'] =
'`u` に関連付けられた値を返す。'
debug.getuservalue['>5.4'] =
'ユーザデータ `u` に関連付けられた第 `n` のユーザ値と、ユーザデータがその値を持っているかどうかのブール値を返す。'
debug.setcstacklimit =
[[
### **Deprecated in `Lua 5.4.2`**
Cスタックの新しい閾値を設定し、古い閾値を返す。設定にしっばいした場合、`false` を返す。
閾値を設定することでLuaにおける呼び出し深さを制限し、スタックオーバーフローを防ぐことができる。
]]
debug.setfenv =
'指定された `object` の環境を `table` に設定する。'
debug.sethook =
'指定された関数をフックとして設定する。'
debug.setlocal =
'スタックレベル `level` にある関数のインデックス `local` にあるローカル変数に `value` を割り当てる。'
debug.setmetatable =
'指定された値のメタテーブルを `table` に設定する(`table` は `nil` であってもよい)。'
debug.setupvalue =
'インデックス `up` のアップバリューに `value` を割り当てる。'
debug.setuservalue['<5.3'] =
'`value` を `udata` に関連付けられた値として設定する。'
debug.setuservalue['>5.4'] =
'`value` を `udata` の第 `n` の関連値として設定する。'
debug.traceback =
'コールスタックのトレース情報を表す文字列を返す。`message` が指定された場合、トレース情報の先頭に追加される。'
debug.upvalueid =
'指定された関数の第 `n` のアップバリューを一意的に特定できる軽量ユーザデータを返す。'
debug.upvaluejoin =
'クロージャ `f1` の第 `n1` アップバリューを、クロージャ `f2` の第 `n2` アップバリューの参照に置き換える。'
infowhat.n =
'`name` と `namewhat`'
infowhat.S =
'`source`, `short_src`, `linedefined`, `lastlinedefined`, と `what` '
infowhat.l =
'`currentline`'
infowhat.t =
'`istailcall`'
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
'`nups`, `nparams`, と `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
'`ftransfer` と `ntransfer`'
infowhat.L =
'`activelines`'
hookmask.c =
'Lua が関数を呼び出すたびにフックを呼び出す。'
hookmask.r =
'Lua が関数から戻るたびにフックを呼び出す。'
hookmask.l =
'Lua が新しい行の実行を開始するたびにフックを呼び出す。'
file =
''
file[':close'] =
'ファイルをクローズする。'
file[':flush'] =
'書き込まれたデータを `file` に保存する。'
file[':lines'] =
[[
------
```lua
for c in file:lines(...) do
body
end
```
]]
file[':read'] =
'指定されたフォーマットに従い `file` を読み取る。'
file[':seek'] =
'ファイルの先頭からの位置を設定、あるいは取得する。'
file[':setvbuf'] =
'出力ファイルのバッファリングモードを設定する。'
file[':write'] =
'渡された引数をすべて `file` に書き込む。'
readmode.n =
'数値を読み取り、Lua の変換規則に従い浮動小数点数または整数を返す。'
readmode.a =
'現在の位置からファイル全体を読み取る。'
readmode.l =
'次の行を読み取る。改行コードは出力から除外される。'
readmode.L =
'次の行を読み取る。改行コードは出力に含まれる。'
seekwhence.set =
'基準点はファイル先頭。'
seekwhence.cur =
'基準点は現在位置。'
seekwhence['.end'] =
'基準点はファイル末尾。'
vbuf.no =
'バッファリングせずに、直ちに出力する。'
vbuf.full =
'バッファがいっぱいになるか、`flush` が呼び出されるまで出力されない。'
vbuf.line =
'改行時に出力する。'
io =
''
io.stdin =
'標準入力'
io.stdout =
'標準出力'
io.stderr =
'標準エラー'
io.close =
'`file` またはデフォルトの出力ファイルをクローズする。'
io.flush =
'書き込まれたデータをデフォルトの出力ファイルに保存する。'
io.input =
'`file` をデフォルトの入力ファイルとして設定する。'
io.lines =
[[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
io.open =
'`mode` で指定された形式でファイルを開く。'
io.output =
'`file` をデフォルトの出力ファイルとして設定する。'
io.popen =
'プログラム `prog` をサブプロセスとして起動する。'
io.read =
'指定されたフォーマットに従い `file` を読み取る。'
io.tmpfile =
'成功した場合、新規のテンポラリファイルへのハンドルを返す。'
io.type =
'`obj` が有効なファイルハンドルであるかどうかを確認する。'
io.write =
'渡された引数をすべてデフォルトの出力ファイルに書き込む。'
openmode.r =
'読み取りモード。'
openmode.w =
'書き込みモード。'
openmode.a =
'追加モード。'
openmode['.r+'] =
'読み取り更新モード。既存のデータはすべて保持され、ファイルへの書き込みも可能。'
openmode['.w+'] =
'書き込み更新モード。既存のデータはすべて削除され、ファイルからの読み取りも可能。'
openmode['.a+'] =
'追加更新モード。既存のデータはすべて保持され、ファイルの末尾でのみ書き込みが可能。'
openmode.rb =
'バイナリ読み取りモード。'
openmode.wb =
'バイナリ書き込みモード。'
openmode.ab =
'バイナリ追加モード。'
openmode['.r+b'] =
'バイナリ読み取り更新モード。既存のデータはすべて保持され、ファイルへの書き込みも可能。'
openmode['.w+b'] =
'バイナリ書き込み更新モード。既存のデータはすべて削除され、ファイルからの読み取りも可能。'
openmode['.a+b'] =
'バイナリ追加更新モード。既存のデータはすべて保持され、ファイルの末尾でのみ書き込みが可能。'
popenmode.r =
'このプログラムからデータを読み取る。(バイナリモード)'
popenmode.w =
'このプログラムにデータを書き込む。(バイナリモード)'
filetype.file =
'開いているファイルへのハンドル。'
filetype['.closed file'] =
'クローズされているファイルへのハンドル。'
filetype['.nil'] =
'ファイルハンドルではない。'
math =
''
math.abs =
'`x` の絶対値を返す。'
math.acos =
'`x` の逆余弦をラジアン単位で返す。'
math.asin =
'`x` の逆正弦をラジアン単位で返す。'
math.atan['<5.2'] =
'`x` の逆正接をラジアン単位で返す。'
math.atan['>5.3'] =
'`y/x`の逆正接をラジアン単位で返す。'
math.atan2 =
'`y/x`の逆正接をラジアン単位で返す。'
math.ceil =
'`x` 以上の最小の整数値を返す。'
math.cos =
'`x` の余弦を返す。`x` はラジアン単位である必要がある。'
math.cosh =
'`x` の双曲線余弦を返す。`x` はラジアン単位である必要がある。'
math.deg =
'角度 `x` をラジアンから度に変換する。'
math.exp =
'`e^x`の値を返すe は自然対数の底)。'
math.floor =
'`x` 以下の最大の整数値を返す。'
math.fmod =
'`x` を `y` で割った余りを返す。'
math.frexp =
'`x` を仮数と指数に分解し、`x = m * (2 ^ e)` となるような `m` と `e` を返す。`e` は整数で、`m` の絶対値は [0.5, 1) の範囲内にある。ただし、`x` が0の場合には `m` も0となる。'
math.huge =
'任意の数値よりも大きい浮動小数点数。'
math.ldexp =
'`m * (2 ^ e)`の値を返す。'
math.log['<5.1'] =
'`x` の自然対数を返す。'
math.log['>5.2'] =
'指定された底での `x` の対数を返す。'
math.log10 =
'10を底とした `x` の対数を返す。'
math.max =
'引数の中で最も大きい値を返す。比較はLuaの`<`演算子によって行われる。'
math.maxinteger['>5.3'] =
'最大整数値。'
math.min =
'引数の中で最も小さい値を返す。比較はLuaの`<`演算子によって行われる。'
math.mininteger['>5.3'] =
'最小整数値。'
math.modf =
'`x` の整数部分と小数部分を返す。'
math.pi =
'*π*の値。'
math.pow =
'`x ^ y`の値を返す。'
math.rad =
'角度 `x` を度からラジアンに変換する。'
math.random =
[[
* `math.random()`: [0,1) 区間内の浮動小数点を返す。
* `math.random(n)`: [1, n] 区間内の整数を返す。
* `math.random(m, n)`: [m, n] 区間内の整数を返す。
]]
math.randomseed['<5.3'] =
'擬似乱数生成器のシードを `x` として設定する。'
math.randomseed['>5.4'] =
[[
* `math.randomseed(x, y)`: `x` と `y` を128ビットの数値に結合し、それを乱数生成器のシードとして設定する。
* `math.randomseed(x)`: `math.randomseed(x, 0)` と同等。
* `math.randomseed()`: ある程度ランダム性のある数値を乱数生成器のシードとして設定する。
]]
math.sin =
'`x` の正弦を返す。`x` はラジアン単位である必要がある。'
math.sinh =
'`x` の双曲線正弦を返す。`x` はラジアン単位である必要がある。'
math.sqrt =
'`x` の平方根を返す。'
math.tan =
'`x` の正接を返す。`x` はラジアン単位である必要がある。'
math.tanh =
'`x` の双曲線正接を返す。`x` はラジアン単位である必要がある。'
math.tointeger['>5.3'] =
'`x` が整数に変換可能であれば、その整数を返す。'
math.type['>5.3'] =
'`x` が整数であれば`"integer"`、浮動小数点数であれば `"float"`、数字でなければ `nil` を返す。'
math.ult['>5.3'] =
'整数 `m` と `n` を符号なし整数として比較し、`m` が `n` より小さい場合に `true` を返す。'
os =
''
os.clock =
'プログラムが使用したCPU時間の概算値を秒単位で返す。'
os.date =
'指定された `format` に従い、日付と時刻を含む文字列またはテーブルを返す。'
os.difftime =
'`t1` と `t2` の時刻差を秒単位で返す。'
os.execute =
'`command` をシステムインタプリタで実行する。'
os.exit['<5.1'] =
'C言語の `exit` 関数を呼び出しホストプログラムを終了させる。'
os.exit['>5.2'] =
'ISO Cの `exit` 関数を呼び出しホストプログラムを終了させる。'
os.getenv =
'環境変数 `varname` の値を返す。'
os.remove =
'指定された名前のファイルを削除する。'
os.rename =
'ファイルまたはディレクトリの名前を変更する。'
os.setlocale =
'プログラムのロケールを設定する。'
os.time =
'引数がない場合、現在の時刻を返す。テーブルが渡されると、そのテーブルが表す時刻を返す。'
os.tmpname =
'テンポラリファイルに使用できるファイル名を返す。'
osdate.year =
'4桁'
osdate.month =
'1-12'
osdate.day =
'1-31'
osdate.hour =
'時間0-23'
osdate.min =
'0-59'
osdate.sec =
'0-61'
osdate.wday =
'曜日1-7の数字で、1が日曜日'
osdate.yday =
'その年の元日からの日数1-366'
osdate.isdst =
'夏時間(日光節約時間)を表すブール値'
package =
''
require['<5.3'] =
'モジュールを読み込み、そのモジュールの戻り値を返す。ただし、モジュールの戻り値が `nil` の場合、`true` を返す。'
require['>5.4'] =
'モジュールを読み込み、そのモジュールの戻り値を返す(モジュールの戻り値が `nil` の場合、`true` を返す)。第二の戻り値として、読み込まれたモジュールの探索結果を返す (ファイルの場合にはファイルパス)。'
package.config =
'パッケージ管理に関連したコンパイル時設定を表す文字列。'
package.cpath =
'`require` がCローダーで検索する際に使用するパス。'
package.loaded =
'`require` が利用するテーブルの一つ。特定のモジュールが既に読み込まれたかどうかの確認に用いられる。'
package.loaders =
'`require` が利用するテーブルの一つ。モジュールがどのようにロードされるかを制御するのに用いられる。'
package.loadlib =
'Cライブラリ `libname` をホストプログラムに動的リンクする。'
package.path =
'`require` が利用する設定の一つ。Luaローダーの検索パスを表す。'
package.preload =
'特定のモジュールの読み込みに利用されるローダーを保持するテーブル。'
package.searchers =
'`require` が利用するテーブルの一つ。モジュールがどのようにロードされるかを制御するのに用いられる。'
package.searchpath =
'指定された `path` から `name` を検索する。'
package.seeall =
'指定されたモジュールのメタテーブルにグローバル環境を参照した `__index` を設定することで、モジュール内からグローバル環境の値をアクセスできるようにする。`module` 関数に渡される設定の一つ。'
string =
''
string.byte =
'文字列 `s[i]`、`s[i+1]`、...、`s[j]` の文字コードを返す。'
string.char =
'0個以上の整数を受け取り、それぞれを対応する文字に変換し、これらのシーケンスを連結した文字列を返す。'
string.dump =
'指定した関数をバイナリ形式(*バイナリコードブロック*)で表した文字列を返す。'
string.find =
'文字列の中から `pattern` に最初にマッチした部分を探す§6.4.1 を参照)。マッチしたものが見つかった場合、マッチした部分の最初と最後のインデックスを返す。見つからなかった場合、`nil` を返す。'
string.format =
'第一引数で指定されたフォーマットに沿って、可変数の引数を成形したものを返す。'
string.gmatch =
[[
呼び出される度に文字列 `s` から `pattern` に次にマッチした部分を返すイテレータ関数を返す§6.4.1 を参照)。
例えば、次のコードは文字列 `s` 内のすべての単語を反復処理し、各単語を一行ずつ出力する:
```lua
s = "hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gsub =
'文字列 `s` の中の `pattern` にマッチした部分をすべて `repl` に置き換えた文字列を返す§6.4.1 を参照)。`n` が指定された場合、最初にマッチした `n` 個の部分のみを置き換える。'
string.len =
'文字列の長さを返す。'
string.lower =
'文字列内のすべての大文字を小文字に取り換えた文字列を返す。'
string.match =
'文字列の中から `pattern` に最初にマッチした部分を返す§6.4.1 を参照)。マッチしたものがない場合、`nil` を返す。'
string.pack =
'第一引数で指定されたフォーマットに沿って、可変数の引数をバイナリ文字列にシリアライズしたものを返す§6.4.2 を参照)。'
string.packsize =
'指定されたフォーマットを用いて`string.pack`によって生成された文字列の長さを返す。フォーマット文字列には可変長オプション `s` または `z` を含めることはできない§6.4.2 を参照)。'
string.rep['>5.2'] =
'`n` 個の文字列 `s` を文字列 `sep` で区切って連結した文字列を返す。デフォルトの `sep` は空文字列。`n` が正数でない場合は空文字列を返す。'
string.rep['<5.1'] =
'`n` 個の文字列 `s` を連結した文字列を返す。`n` が正数でない場合は空文字列を返す。'
string.reverse =
'文字列 `s` を逆順で並び変えた文字列を返す。'
string.sub =
'インデックス `i` で始まり、`j` まで続く部分文字列を返す。'
string.unpack =
'フォーマット `fmt` を用いて`string.pack`によって生成された文字列の元の値を返す§6.4.2 を参照)。'
string.upper =
'文字列内のすべての小文字を大文字に取り換えた文字列を返す。'
table =
''
table.concat =
'すべての要素が文字列または数値であるリストに対して、`list[i]..sep..list[i+1] ··· sep..list[j]` という文字列を返す。'
table.insert =
'要素 `value` を `list` の位置 `pos` に挿入する。'
table.maxn =
'指定されたテーブルの最も大きな正の数値インデックスを返す。正の数値インデックスがない場合はゼロを返す。'
table.move =
[[
テーブル `a1` からテーブル `a2` に要素を移動する。
```lua
a2[t],··· =
a1[f],···,a1[e]
return a2
```
]]
table.pack =
'すべての引数をキー `1`、`2` などに格納し、引数の総数を示す `"n"` フィールドを持つテーブルを返す。'
table.remove =
'`list` の位置 `pos` にある要素を削除し、削除された要素の値を返す。'
table.sort =
'リストの要素を指定された順序で*内部*ソートする。ソートは `list[1]` から `list[#list]` まで行われる。'
table.unpack =
[[
指定されたリストの要素を返す。この関数は次と同等である(デフォルトでは `i` が `1` で `j` が `#list`)。
```lua
return list[i], list[i+1], ···, list[j]
```
]]
table.foreach =
[[
テーブル内の各要素に対し `f` を適用する。`f` は各要素のキーと値を引数として呼び出される。`f` が `nil` 以外の値を返すとループが終了し、その値が `foreach` の最終的な戻り値として返される。
非推薦関数のため、$pairs を優先してください。
]]
table.foreachi =
[[
テーブル内の数値キーを持つ要素に対して `f` を適用する。`f` は各要素のキーと値を引数として呼び出される。`f` が `nil` 以外の値を返すとループが終了し、その値が `foreach` の最終的な戻り値として返される。
非推薦関数のため、$ipairs を優先してください。
]]
table.getn =
'テーブルの長さを返す。`#list` と同等。'
table.new = -- TODO: need translate!
[[This creates a pre-sized table, just like the C API equivalent `lua_createtable()`. This is useful for big tables if the final table size is known and automatic table resizing is too expensive. `narray` parameter specifies the number of array-like items, and `nhash` parameter specifies the number of hash-like items. The function needs to be required before use.
```lua
require("table.new")
```
]]
table.clear = -- TODO: need translate!
[[This clears all keys and values from a table, but preserves the allocated array/hash sizes. This is useful when a table, which is linked from multiple places, needs to be cleared and/or when recycling a table for use by the same context. This avoids managing backlinks, saves an allocation and the overhead of incremental array/hash part growth. The function needs to be required before use.
```lua
require("table.clear").
```
Please note this function is meant for very specific situations. In most cases it's better to replace the (usually single) link with a new table and let the GC do its work.
]]
utf8 =
''
utf8.char =
'0個以上の整数を受け取り、それぞれを対応するUTF-8文字に変換し、これらの文字を連結した文字列を返す。'
utf8.charpattern =
'1つのUTF-8文字にマッチするパターンを返す。このパターンを用いる際には、対象の文字列が有効なUTF-8文字列である必要がある。'
utf8.codes =
[[
次の構文において`p`が各UTF-8文字のバイト位置、`c`が各UTF-8文字の文字コードとなるような値を返す。無効なバイトシーケンスが文字列に含まれた場合にはエラーを出す。
```lua
for p, c in utf8.codes(s) do
body
end
```
]]
utf8.codepoint =
'バイト位置 `i` から `j`両方含むの間に含まれるすべてのUTF-8文字コード整数を返す。'
utf8.len =
'バイト位置 `i` から `j`両方含むの間に含まれるUTF-8文字の数を返す。'
utf8.offset =
'文字列 `s` における `n` 番目の文字が始まるバイト位置をを返す。`i` が指定された場合、`i` から数えたバイト位置を返す。'

View File

@@ -0,0 +1,480 @@
---@diagnostic disable: undefined-global
config.addonManager.enable = -- TODO: need translate!
"Whether the addon manager is enabled or not."
config.addonManager.repositoryBranch = -- TODO: need translate!
"Specifies the git branch used by the addon manager."
config.addonManager.repositoryPath = -- TODO: need translate!
"Specifies the git path used by the addon manager."
config.addonRepositoryPath = -- TODO: need translate!
"Specifies the addon repository path (not related to the addon manager)."
config.runtime.version = -- TODO: need translate!
"Lua runtime version."
config.runtime.path = -- TODO: need translate!
[[
When using `require`, how to find the file based on the input name.
Setting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.
if `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.
If you want to load files outside the workspace, you need to set `Lua.workspace.library` first.
]]
config.runtime.pathStrict = -- TODO: need translate!
'When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`.'
config.runtime.special = -- TODO: need translate!
[[The custom global variables are regarded as some special built-in variables, and the language server will provide special support
The following example shows that 'include' is treated as' require '.
```json
"Lua.runtime.special" : {
"include" : "require"
}
```
]]
config.runtime.unicodeName = -- TODO: need translate!
"Allows Unicode characters in name."
config.runtime.nonstandardSymbol = -- TODO: need translate!
"Supports non-standard symbols. Make sure that your runtime environment supports these symbols."
config.runtime.plugin = -- TODO: need translate!
"Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more."
config.runtime.pluginArgs = -- TODO: need translate!
"Additional arguments for the plugin."
config.runtime.fileEncoding = -- TODO: need translate!
"File encoding. The `ansi` option is only available under the `Windows` platform."
config.runtime.builtin = -- TODO: need translate!
[[
Adjust the enabled state of the built-in library. You can disable (or redefine) the non-existent library according to the actual runtime environment.
* `default`: Indicates that the library will be enabled or disabled according to the runtime version
* `enable`: always enable
* `disable`: always disable
]]
config.runtime.meta = -- TODO: need translate!
'Format of the directory name of the meta files.'
config.diagnostics.enable = -- TODO: need translate!
"Enable diagnostics."
config.diagnostics.disable = -- TODO: need translate!
"Disabled diagnostic (Use code in hover brackets)."
config.diagnostics.globals = -- TODO: need translate!
"Defined global variables."
config.diagnostics.globalsRegex = -- TODO: need translate!
"Find defined global variables using regex."
config.diagnostics.severity = -- TODO: need translate!
[[
Modify the diagnostic severity.
End with `!` means override the group setting `diagnostics.groupSeverity`.
]]
config.diagnostics.neededFileStatus = -- TODO: need translate!
[[
* Opened: only diagnose opened files
* Any: diagnose all files
* None: disable this diagnostic
End with `!` means override the group setting `diagnostics.groupFileStatus`.
]]
config.diagnostics.groupSeverity = -- TODO: need translate!
[[
Modify the diagnostic severity in a group.
`Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` separately.
Other settings will override individual settings without end of `!`.
]]
config.diagnostics.groupFileStatus = -- TODO: need translate!
[[
Modify the diagnostic needed file status in a group.
* Opened: only diagnose opened files
* Any: diagnose all files
* None: disable this diagnostic
`Fallback` means that diagnostics in this group are controlled by `diagnostics.neededFileStatus` separately.
Other settings will override individual settings without end of `!`.
]]
config.diagnostics.workspaceEvent = -- TODO: need translate!
"Set the time to trigger workspace diagnostics."
config.diagnostics.workspaceEvent.OnChange = -- TODO: need translate!
"Trigger workspace diagnostics when the file is changed."
config.diagnostics.workspaceEvent.OnSave = -- TODO: need translate!
"Trigger workspace diagnostics when the file is saved."
config.diagnostics.workspaceEvent.None = -- TODO: need translate!
"Disable workspace diagnostics."
config.diagnostics.workspaceDelay = -- TODO: need translate!
"Latency (milliseconds) for workspace diagnostics."
config.diagnostics.workspaceRate = -- TODO: need translate!
"Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also reduces the speed of workspace diagnostics. The diagnosis of the file you are currently editing is always done at full speed and is not affected by this setting."
config.diagnostics.libraryFiles = -- TODO: need translate!
"How to diagnose files loaded via `Lua.workspace.library`."
config.diagnostics.libraryFiles.Enable = -- TODO: need translate!
"Always diagnose these files."
config.diagnostics.libraryFiles.Opened = -- TODO: need translate!
"Only when these files are opened will it be diagnosed."
config.diagnostics.libraryFiles.Disable = -- TODO: need translate!
"These files are not diagnosed."
config.diagnostics.ignoredFiles = -- TODO: need translate!
"How to diagnose ignored files."
config.diagnostics.ignoredFiles.Enable = -- TODO: need translate!
"Always diagnose these files."
config.diagnostics.ignoredFiles.Opened = -- TODO: need translate!
"Only when these files are opened will it be diagnosed."
config.diagnostics.ignoredFiles.Disable = -- TODO: need translate!
"These files are not diagnosed."
config.diagnostics.disableScheme = -- TODO: need translate!
'Do not diagnose Lua files that use the following scheme.'
config.diagnostics.unusedLocalExclude = -- TODO: need translate!
'Do not diagnose `unused-local` when the variable name matches the following pattern.'
config.workspace.ignoreDir = -- TODO: need translate!
"Ignored files and directories (Use `.gitignore` grammar)."-- .. example.ignoreDir,
config.workspace.ignoreSubmodules = -- TODO: need translate!
"Ignore submodules."
config.workspace.useGitIgnore = -- TODO: need translate!
"Ignore files list in `.gitignore` ."
config.workspace.maxPreload = -- TODO: need translate!
"Max preloaded files."
config.workspace.preloadFileSize = -- TODO: need translate!
"Skip files larger than this value (KB) when preloading."
config.workspace.library = -- TODO: need translate!
"In addition to the current workspace, which directories will load files from. The files in these directories will be treated as externally provided code libraries, and some features (such as renaming fields) will not modify these files."
config.workspace.checkThirdParty = -- TODO: need translate!
[[
Automatic detection and adaptation of third-party libraries, currently supported libraries are:
* OpenResty
* Cocos4.0
* LÖVE
* LÖVR
* skynet
* Jass
]]
config.workspace.userThirdParty = -- TODO: need translate!
'Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd)'
config.workspace.supportScheme = -- TODO: need translate!
'Provide language server for the Lua files of the following scheme.'
config.completion.enable = -- TODO: need translate!
'Enable completion.'
config.completion.callSnippet = -- TODO: need translate!
'Shows function call snippets.'
config.completion.callSnippet.Disable = -- TODO: need translate!
"Only shows `function name`."
config.completion.callSnippet.Both = -- TODO: need translate!
"Shows `function name` and `call snippet`."
config.completion.callSnippet.Replace = -- TODO: need translate!
"Only shows `call snippet.`"
config.completion.keywordSnippet = -- TODO: need translate!
'Shows keyword syntax snippets.'
config.completion.keywordSnippet.Disable = -- TODO: need translate!
"Only shows `keyword`."
config.completion.keywordSnippet.Both = -- TODO: need translate!
"Shows `keyword` and `syntax snippet`."
config.completion.keywordSnippet.Replace = -- TODO: need translate!
"Only shows `syntax snippet`."
config.completion.displayContext = -- TODO: need translate!
"Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled."
config.completion.workspaceWord = -- TODO: need translate!
"Whether the displayed context word contains the content of other files in the workspace."
config.completion.showWord = -- TODO: need translate!
"Show contextual words in suggestions."
config.completion.showWord.Enable = -- TODO: need translate!
"Always show context words in suggestions."
config.completion.showWord.Fallback = -- TODO: need translate!
"Contextual words are only displayed when suggestions based on semantics cannot be provided."
config.completion.showWord.Disable = -- TODO: need translate!
"Do not display context words."
config.completion.autoRequire = -- TODO: need translate!
"When the input looks like a file name, automatically `require` this file."
config.completion.showParams = -- TODO: need translate!
"Display parameters in completion list. When the function has multiple definitions, they will be displayed separately."
config.completion.requireSeparator = -- TODO: need translate!
"The separator used when `require`."
config.completion.postfix = -- TODO: need translate!
"The symbol used to trigger the postfix suggestion."
config.color.mode = -- TODO: need translate!
"Color mode."
config.color.mode.Semantic = -- TODO: need translate!
"Semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect."
config.color.mode.SemanticEnhanced = -- TODO: need translate!
"Enhanced semantic color. Like `Semantic`, but with additional analysis which might be more computationally expensive."
config.color.mode.Grammar = -- TODO: need translate!
"Grammar color."
config.semantic.enable = -- TODO: need translate!
"Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect."
config.semantic.variable = -- TODO: need translate!
"Semantic coloring of variables/fields/parameters."
config.semantic.annotation = -- TODO: need translate!
"Semantic coloring of type annotations."
config.semantic.keyword = -- TODO: need translate!
"Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring."
config.signatureHelp.enable = -- TODO: need translate!
"Enable signature help."
config.hover.enable = -- TODO: need translate!
"Enable hover."
config.hover.viewString = -- TODO: need translate!
"Hover to view the contents of a string (only if the literal contains an escape character)."
config.hover.viewStringMax = -- TODO: need translate!
"The maximum length of a hover to view the contents of a string."
config.hover.viewNumber = -- TODO: need translate!
"Hover to view numeric content (only if literal is not decimal)."
config.hover.fieldInfer = -- TODO: need translate!
"When hovering to view a table, type infer will be performed for each field. When the accumulated time of type infer reaches the set value (MS), the type infer of subsequent fields will be skipped."
config.hover.previewFields = -- TODO: need translate!
"When hovering to view a table, limits the maximum number of previews for fields."
config.hover.enumsLimit = -- TODO: need translate!
"When the value corresponds to multiple types, limit the number of types displaying."
config.hover.expandAlias = -- TODO: need translate!
[[
Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.
]]
config.develop.enable = -- TODO: need translate!
'Developer mode. Do not enable, performance will be affected.'
config.develop.debuggerPort = -- TODO: need translate!
'Listen port of debugger.'
config.develop.debuggerWait = -- TODO: need translate!
'Suspend before debugger connects.'
config.intelliSense.searchDepth = -- TODO: need translate!
'Set the search depth for IntelliSense. Increasing this value increases accuracy, but decreases performance. Different workspace have different tolerance for this setting. Please adjust it to the appropriate value.'
config.intelliSense.fastGlobal = -- TODO: need translate!
'In the global variable completion, and view `_G` suspension prompt. This will slightly reduce the accuracy of type speculation, but it will have a significant performance improvement for projects that use a lot of global variables.'
config.window.statusBar = -- TODO: need translate!
'Show extension status in status bar.'
config.window.progressBar = -- TODO: need translate!
'Show progress bar in status bar.'
config.hint.enable = -- TODO: need translate!
'Enable inlay hint.'
config.hint.paramType = -- TODO: need translate!
'Show type hints at the parameter of the function.'
config.hint.setType = -- TODO: need translate!
'Show hints of type at assignment operation.'
config.hint.paramName = -- TODO: need translate!
'Show hints of parameter name at the function call.'
config.hint.paramName.All = -- TODO: need translate!
'All types of parameters are shown.'
config.hint.paramName.Literal = -- TODO: need translate!
'Only literal type parameters are shown.'
config.hint.paramName.Disable = -- TODO: need translate!
'Disable parameter hints.'
config.hint.arrayIndex = -- TODO: need translate!
'Show hints of array index when constructing a table.'
config.hint.arrayIndex.Enable = -- TODO: need translate!
'Show hints in all tables.'
config.hint.arrayIndex.Auto = -- TODO: need translate!
'Show hints only when the table is greater than 3 items, or the table is a mixed table.'
config.hint.arrayIndex.Disable = -- TODO: need translate!
'Disable hints of array index.'
config.hint.await = -- TODO: need translate!
'If the called function is marked `---@async`, prompt `await` at the call.'
config.hint.awaitPropagate = -- TODO: need translate!
'Enable the propagation of `await`. When a function calls a function marked `---@async`,\z
it will be automatically marked as `---@async`.'
config.hint.semicolon = -- TODO: need translate!
'If there is no semicolon at the end of the statement, display a virtual semicolon.'
config.hint.semicolon.All = -- TODO: need translate!
'All statements display virtual semicolons.'
config.hint.semicolon.SameLine = -- TODO: need translate!
'When two statements are on the same line, display a semicolon between them.'
config.hint.semicolon.Disable = -- TODO: need translate!
'Disable virtual semicolons.'
config.codeLens.enable = -- TODO: need translate!
'Enable code lens.'
config.format.enable = -- TODO: need translate!
'Enable code formatter.'
config.format.defaultConfig = -- TODO: need translate!
[[
The default format configuration. Has a lower priority than `.editorconfig` file in the workspace.
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.spell.dict = -- TODO: need translate!
'Custom words for spell checking.'
config.nameStyle.config = -- TODO: need translate!
[[
Set name style config.
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.telemetry.enable = -- TODO: need translate!
[[
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).
]]
config.misc.parameters = -- TODO: need translate!
'[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language server in VSCode.'
config.misc.executablePath = -- TODO: need translate!
'Specify the executable path in VSCode.'
config.language.fixIndent = -- TODO: need translate!
'(VSCode only) Fix incorrect auto-indentation, such as incorrect indentation when line breaks occur within a string containing the word "function."'
config.language.completeAnnotation = -- TODO: need translate!
'(VSCode only) Automatically insert "---@ " after a line break following a annotation.'
config.type.castNumberToInteger = -- TODO: need translate!
'Allowed to assign the `number` type to the `integer` type.'
config.type.weakUnionCheck = -- TODO: need translate!
[[
Once one subtype of a union type meets the condition, the union type also meets the condition.
When this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.
]]
config.type.weakNilCheck = -- TODO: need translate!
[[
When checking the type of union type, ignore the `nil` in it.
When this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.
]]
config.type.inferParamType = -- TODO: need translate!
[[
When a parameter type is not annotated, it is inferred from the function's call sites.
When this setting is `false`, the type of the parameter is `any` when it is not annotated.
]]
config.type.checkTableShape = -- TODO: need translate!
[[
Strictly check the shape of the table.
]]
config.type.inferTableSize = -- TODO: need translate!
'Maximum number of table fields analyzed during type inference.'
config.doc.privateName = -- TODO: need translate!
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
config.doc.protectedName = -- TODO: need translate!
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
config.doc.packageName = -- TODO: need translate!
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
config.doc.regengine = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.doc.regengine.glob = -- TODO: need translate!
'The default lightweight pattern syntax.'
config.doc.regengine.lua = -- TODO: need translate!
'Full Lua-style regular expressions.'
config.docScriptPath = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.diagnostics['unused-local'] = -- TODO: need translate!
'Enable unused local variable diagnostics.'
config.diagnostics['unused-function'] = -- TODO: need translate!
'Enable unused function diagnostics.'
config.diagnostics['undefined-global'] = -- TODO: need translate!
'Enable undefined global variable diagnostics.'
config.diagnostics['global-in-nil-env'] = -- TODO: need translate!
'Enable cannot use global variables `_ENV` is set to `nil` diagnostics.'
config.diagnostics['unused-label'] = -- TODO: need translate!
'Enable unused label diagnostics.'
config.diagnostics['unused-vararg'] = -- TODO: need translate!
'Enable unused vararg diagnostics.'
config.diagnostics['trailing-space'] = -- TODO: need translate!
'Enable trailing space diagnostics.'
config.diagnostics['redefined-local'] = -- TODO: need translate!
'Enable redefined local variable diagnostics.'
config.diagnostics['newline-call'] = -- TODO: need translate!
'Enable newline call diagnostics. Is\'s raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.'
config.diagnostics['newfield-call'] = -- TODO: need translate!
'Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.'
config.diagnostics['redundant-parameter'] = -- TODO: need translate!
'Enable redundant function parameter diagnostics.'
config.diagnostics['ambiguity-1'] = -- TODO: need translate!
'Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.'
config.diagnostics['lowercase-global'] = -- TODO: need translate!
'Enable lowercase global variable definition diagnostics.'
config.diagnostics['undefined-env-child'] = -- TODO: need translate!
'Enable undefined environment variable diagnostics. It\'s raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.'
config.diagnostics['duplicate-index'] = -- TODO: need translate!
'Enable duplicate table index diagnostics.'
config.diagnostics['empty-block'] = -- TODO: need translate!
'Enable empty code block diagnostics.'
config.diagnostics['redundant-value'] = -- TODO: need translate!
'Enable the redundant values assigned diagnostics. It\'s raised during assignment operation, when the number of values is higher than the number of objects being assigned.'
config.diagnostics['assign-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.'
config.diagnostics['await-in-sync'] = -- TODO: need translate!
'Enable diagnostics for calls of asynchronous functions within a synchronous function.'
config.diagnostics['cast-local-type'] = -- TODO: need translate!
'Enable diagnostics for casts of local variables where the target type does not match the defined type.'
config.diagnostics['cast-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for casts where the target type does not match the initial type.'
config.diagnostics['circular-doc-class'] = -- TODO: need translate!
'Enable diagnostics for two classes inheriting from each other introducing a circular relation.'
config.diagnostics['close-non-object'] = -- TODO: need translate!
'Enable diagnostics for attempts to close a variable with a non-object.'
config.diagnostics['code-after-break'] = -- TODO: need translate!
'Enable diagnostics for code placed after a break statement in a loop.'
config.diagnostics['codestyle-check'] = -- TODO: need translate!
'Enable diagnostics for incorrectly styled lines.'
config.diagnostics['count-down-loop'] = -- TODO: need translate!
'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.'
config.diagnostics['deprecated'] = -- TODO: need translate!
'Enable diagnostics to highlight deprecated API.'
config.diagnostics['different-requires'] = -- TODO: need translate!
'Enable diagnostics for files which are required by two different paths.'
config.diagnostics['discard-returns'] = -- TODO: need translate!
'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.'
config.diagnostics['doc-field-no-class'] = -- TODO: need translate!
'Enable diagnostics to highlight a field annotation without a defining class annotation.'
config.diagnostics['duplicate-doc-alias'] = -- TODO: need translate!
'Enable diagnostics for a duplicated alias annotation name.'
config.diagnostics['duplicate-doc-field'] = -- TODO: need translate!
'Enable diagnostics for a duplicated field annotation name.'
config.diagnostics['duplicate-doc-param'] = -- TODO: need translate!
'Enable diagnostics for a duplicated param annotation name.'
config.diagnostics['duplicate-set-field'] = -- TODO: need translate!
'Enable diagnostics for setting the same field in a class more than once.'
config.diagnostics['incomplete-signature-doc'] = -- TODO: need translate!
'Incomplete @param or @return annotations for functions.'
config.diagnostics['invisible'] = -- TODO: need translate!
'Enable diagnostics for accesses to fields which are invisible.'
config.diagnostics['missing-global-doc'] = -- TODO: need translate!
'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.'
config.diagnostics['missing-local-export-doc'] = -- TODO: need translate!
'Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.'
config.diagnostics['missing-parameter'] = -- TODO: need translate!
'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.'
config.diagnostics['missing-return'] = -- TODO: need translate!
'Enable diagnostics for functions with return annotations which have no return statement.'
config.diagnostics['missing-return-value'] = -- TODO: need translate!
'Enable diagnostics for return statements without values although the containing function declares returns.'
config.diagnostics['need-check-nil'] = -- TODO: need translate!
'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.'
config.diagnostics['unnecessary-assert'] = -- TODO: need translate!
'Enable diagnostics for redundant assertions on truthy values.'
config.diagnostics['no-unknown'] = -- TODO: need translate!
'Enable diagnostics for cases in which the type cannot be inferred.'
config.diagnostics['not-yieldable'] = -- TODO: need translate!
'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.'
config.diagnostics['param-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.'
config.diagnostics['redundant-return'] = -- TODO: need translate!
'Enable diagnostics for return statements which are not needed because the function would exit on its own.'
config.diagnostics['redundant-return-value']= -- TODO: need translate!
'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.'
config.diagnostics['return-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
config.diagnostics['spell-check'] = -- TODO: need translate!
'Enable diagnostics for typos in strings.'
config.diagnostics['name-style-check'] = -- TODO: need translate!
'Enable diagnostics for name style.'
config.diagnostics['unbalanced-assignments']= -- TODO: need translate!
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
config.diagnostics['undefined-doc-class'] = -- TODO: need translate!
'Enable diagnostics for class annotations in which an undefined class is referenced.'
config.diagnostics['undefined-doc-name'] = -- TODO: need translate!
'Enable diagnostics for type annotations referencing an undefined type or alias.'
config.diagnostics['undefined-doc-param'] = -- TODO: need translate!
'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.'
config.diagnostics['undefined-field'] = -- TODO: need translate!
'Enable diagnostics for cases in which an undefined field of a variable is read.'
config.diagnostics['unknown-cast-variable'] = -- TODO: need translate!
'Enable diagnostics for casts of undefined variables.'
config.diagnostics['unknown-diag-code'] = -- TODO: need translate!
'Enable diagnostics in cases in which an unknown diagnostics code is entered.'
config.diagnostics['unknown-operator'] = -- TODO: need translate!
'Enable diagnostics for unknown operators.'
config.diagnostics['unreachable-code'] = -- TODO: need translate!
'Enable diagnostics for unreachable code.'
config.diagnostics['global-element'] = -- TODO: need translate!
'Enable diagnostics to warn about global elements.'
config.typeFormat.config = -- TODO: need translate!
'Configures the formatting behavior while typing Lua code.'
config.typeFormat.config.auto_complete_end = -- TODO: need translate!
'Controls if `end` is automatically completed at suitable positions.'
config.typeFormat.config.auto_complete_table_sep = -- TODO: need translate!
'Controls if a separator is automatically appended at the end of a table declaration.'
config.typeFormat.config.format_line = -- TODO: need translate!
'Controls if a line is formatted at all.'
command.exportDocument = -- TODO: need translate!
'Lua: Export Document ...'
command.addon_manager.open = -- TODO: need translate!
'Lua: Open Addon Manager ...'
command.reloadFFIMeta = -- TODO: need translate!
'Lua: Reload luajit ffi meta'
command.startServer = -- TODO: need translate!
'Lua: Restart Language Server'
command.stopServer = -- TODO: need translate!
'Lua: Stop Language Server'

View File

@@ -0,0 +1,764 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
'Argumentos de inicialização para a versão standalone da linguagem Lua.'
assert =
'Emite um erro se o valor de seu argumento v for falso (i.e., `nil` ou `false`); caso contrário, devolve todos os seus argumentos. Em caso de erro, `message` é o objeto de erro que, quando ausente, por padrão é `"assertion failed!"`'
cgopt.collect =
'Realiza um ciclo completo de coleta de lixo (i.e., garbage-collection cycle).'
cgopt.stop =
'Interrompe a execução automática.'
cgopt.restart =
'Reinicia a execução automática.'
cgopt.count =
'Retorna, em Kbytes, a quantidade total de memória utilizada pela linguagem Lua.'
cgopt.step =
'Executa a coleta de lixo (i.e., garbage-collection) em uma única etapa. A quantidade de execuções por etapa é controlada via `arg`.'
cgopt.setpause =
'Estabelece pausa. Defina via `arg` o intervalo de pausa do coletor de lixo (i.e., garbage-collection).'
cgopt.setstepmul =
'Estabelece um multiplicador para etapa de coleta de lixo (i.e., garbage-collection). Defina via `arg` o valor multiplicador.'
cgopt.incremental =
'Altera o modo do coletor para incremental.'
cgopt.generational =
'Altera o modo do coletor para geracional.'
cgopt.isrunning =
'Retorna um valor booleano indicando se o coletor de lixo (i.e., garbage-collection) está em execução.'
collectgarbage =
'Esta função é uma interface genérica para o coletor de lixo (i.e., garbage-collection). Ela executa diferentes funções de acordo com seu primeiro argumento, `opt`.'
dofile =
'Abre o arquivo fornecido por argumento e executa seu conteúdo como código Lua. Quando chamado sem argumentos, `dofile` executa o conteúdo da entrada padrão (`stdin`). Retorna todos os valores retornados pelo trecho de código contido no arquivo. Em caso de erros, o `dofile` propaga o erro para seu chamador. Ou seja, o `dofile` não funciona em modo protegido.'
error =
[[
Termina a última chamada de função protegida e retorna `message` como objeto de `erro`.
Normalmente, o 'erro' adiciona algumas informações sobre a localização do erro no início da mensagem, quando a mensagem for uma string.
]]
_G =
'Uma variável global (não uma função) que detém o ambiente global (ver §2.2). Lua em si não usa esta variável; mudar seu valor não afeta nenhum ambiente e vice-versa.'
getfenv =
'Retorna o ambiente atual em uso pela função. O `f` pode ser uma função Lua ou um número que especifica a função naquele nível de pilha.'
getmetatable =
'Se o objeto não tiver uma metatable, o retorno é `nil`. Mas caso a metatable do objeto tenha um campo `__metatable`, é retornado o valor associado. Caso contrário, retorna a metatable do objeto dado.'
ipairs =
[[
Retorna três valores (uma função iteradora, a tabela `t`, e `0`) para que a seguinte construção
```lua
for i,v in ipairs(t) do body end
```
possa iterar sobre os pares de valor-chave `(1,t[1]), (2,t[2]), ...`, até o primeiro índice ausente.
]]
loadmode.b =
'Somente blocos binários.'
loadmode.t =
'Somente blocos de texto.'
loadmode.bt =
'Tanto binário quanto texto.'
load['<5.1'] =
'Carrega um bloco utilizando a função `func` para obter suas partes. Cada chamada para o `func` deve retornar uma string que é concatenada com os resultados anteriores.'
load['>5.2'] =
[[
Carrega um bloco.
Se o bloco (i.e., `chunk`) é uma string, o bloco é essa string. Se o bloco é uma função, a função "load" é chamada repetidamente para obter suas partes. Cada chamada para o bloco deve retornar uma string que é concatenada com os resultados anteriores. O fim do bloco é sinalizado com o retorno de uma string vazia ou `nil`.
]]
loadfile =
'Carrega um bloco de arquivo `filename` ou da entrada padrão, se nenhum nome de arquivo for dado.'
loadstring =
'Carrega um bloco a partir de uma string dada.'
module =
'Cria um módulo.'
next =
[[
Permite que um programa percorra todos os campos de uma tabela. Seu primeiro argumento é uma tabela e seu segundo argumento é um índice nesta tabela. Uma chamada `next` retorna o próximo índice da tabela e seu valor associado. Quando chamado usando `nil` como segundo argumento, `next` retorna um índice inicial e seu valor associado. Quando chamado com o último índice, ou com `nil` em uma tabela vazia, o `next` retorna o `nil`. Se o segundo argumento estiver ausente, então é interpretado como `nil`. Portanto, pode-se utilizar o `next(t)` para verificar se uma tabela está vazia.
A ordem na qual os índices são enumerados não é especificada, *mesmo para índices numéricos*. (Para percorrer uma tabela em ordem numérica, utilize um `for`).
O comportamento do `next` é indefinido se, durante a iteração/travessia, você atribuir qualquer valor a um campo inexistente na tabela. Você pode, entretanto, modificar os campos existentes e pode, inclusive, os definir como nulos.
]]
pairs =
[[
Se `t` tem um "meta" método (i.e., metamethod) `__pairs`, a chamada é feita usando t como argumento e retorna os três primeiros resultados.
Caso contrário, retorna três valores: a função $next, a tabela `t` e `nil`, para que a seguinte construção
```lua
for k,v in pairs(t) do body end
```
possa iterar sobre todos os pares de valor-chave da tabela 't'.
Veja a função $next para saber as ressalvas em modificar uma tabela durante sua iteração.
]]
pcall =
[[
Chama a função `f` com os argumentos dados em modo *protegido*. Isto significa que qualquer erro dentro de `f` não é propagado; em vez disso, o `pcall` captura o erro e retorna um código de status. Seu primeiro resultado é o código de status (booleano), que é verdadeiro se a chamada for bem sucedida sem erros. Neste caso, `pcall' também retorna todos os resultados da chamada, após este primeiro resultado. Em caso de qualquer erro, `pcall` retorna `false` mais o objeto de erro.
]]
print =
[[
Recebe qualquer número de argumentos e imprime seus valores na saída padrão `stdout`, convertendo cada argumento em uma string seguindo as mesmas regras do $tostring.
A função `print` não é destinada à saída formatada, mas apenas como uma forma rápida de mostrar um valor, por exemplo, para debugging. Para controle completo sobre a saída, use $string.format e $io.write.
]]
rawequal =
'Verifica se v1 é igual a v2, sem invocar a metatable `__eq`.'
rawget =
'Obtém o valor real de `table[index]`, sem invocar a metatable `__index`.'
rawlen =
'Retorna o comprimento do objeto `v`, sem invocar a metatable `__len`.'
rawset =
[[
Define o valor real de `table[index]` para `value`, sem utilizar o metavalue `__newindex`. `table` deve ser uma tabela, `index` qualquer valor diferente de `nil` e `NaN`, e `value` qualquer valor de tipos do Lua.
Esta função retorna uma `table`.
]]
select =
'Se `index` é um número, retorna todos os argumentos após o número do argumento `index`; um número negativo de índices do final (`-1` é o último argumento). Caso contrário, `index` deve ser a string `"#"`, e `select` retorna o número total de argumentos extras dados.'
setfenv =
'Define o ambiente a ser utilizado pela função em questão.'
setmetatable =
[[
Define a metatable para a tabela dada. Se `metatabela` for `nil`, remove a metatable da tabela em questão. Se a metatable original tiver um campo `__metatable', um erro é lançado.
Esta função retorna uma `table`.
Para alterar a metatable de outros tipos do código Lua, você deve utilizar a biblioteca de debugging (§6.10).
]]
tonumber =
[[
Quando chamado sem a base, `tonumber` tenta converter seu argumento para um número. Se o argumento já for um número ou uma string numérica, então `tonumber` retorna este número; caso contrário, retorna `fail`.
A conversão de strings pode resultar em números inteiros ou de ponto flutuante, de acordo com as convenções lexicais de Lua (ver §3.1). A string pode ter espaços antes e depois e um sinal.
]]
tostring =
[[
Recebe um valor de qualquer tipo e o converte em uma string em formato legível por humanos.
Se a metatable de `v` tem um campo `__tostring', então `tostring' chama o valor correspondente usando `v` como argumento, e utiliza o resultado da chamada como seu resultado. Caso contrário, se a metatable de `v` tiver um campo `__name` com um valor do tipo string, `tostring` pode utilizar essa string em seu resultado final.
Para controle completo de como os números são convertidos, utilize $string.format.
]]
type =
[[
Retorna o tipo de seu único argumento, codificado como uma string. Os resultados possíveis desta função são `"nil"` (uma string, não o valor `nil`), `"number"`, `"string"`, `"boolean"`, `"table"`, `"function"`, `"thread"`, e `"userdata"`.
]]
_VERSION =
'Uma variável global (não uma função) que contém uma string contendo a versão Lua em execução.'
warn =
'Emite um aviso com uma mensagem composta pela concatenação de todos os seus argumentos (que devem ser strings).'
xpcall['=5.1'] =
'Faz chamada a função `f` com os argumentos dados e em modo protegido, usando um manipulador de mensagens dado.'
xpcall['>5.2'] =
'Faz chamada a função `f` com os argumentos dados e em modo protegido, usando um manipulador de mensagens dado.'
unpack =
[[
Retorna os elementos da lista dada. Esta função é equivalente a
```lua
return list[i], list[i+1], ···, list[j]
```
]]
bit32 =
''
bit32.arshift =
[[
Retorna o número `x` deslocado `disp` bits para a direita. Deslocamentos negativos movem os bits para a esquerda.
Esta operação de deslocamento é chamada de deslocamento aritmético. Os bits vagos à esquerda são preenchidos com cópias do bit mais significativo de `x`; os bits vagos à direita são preenchidos com zeros.
]]
bit32.band =
'Retorna a operação bitwise *and* de seus operandos.'
bit32.bnot =
[[
Retorna a negação da operação bitwise de `x`.
```lua
assert(bit32.bnot(x) ==
(-1 - x) % 2^32)
```
]]
bit32.bor =
'Retorna a operação bitwise *or* de seus operandos.'
bit32.btest =
'Retorna um valor booleano verdadeiro se a operação bitwise *and* de seus operandos for diferente de zero. Falso, caso contrário.'
bit32.bxor =
'Retorna a operação bitwise *exclusive or* de seus operandos.'
bit32.extract =
'Retorna o número formado pelos bits de `field` a `field + width - 1` de `n`, sem sinal.'
bit32.replace =
'Retorna uma cópia de `n` com os bits de `field` a `field + width - 1` substituídos pelo valor `v` .'
bit32.lrotate =
'Retorna o número `x` rotacionado `disp` bits para a esquerda. Rotações negativos movem os bits para a direita. '
bit32.lshift =
[[
Retorna o número `x` deslocado `disp` bits para a esquerda. Deslocamentos negativos movem os bits para a direita. Em ambas as direções, os bits vazios/vagos são preenchidos com zeros.
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
bit32.rrotate =
'Retorna o número `x` rotacionado `disp` bits para a direita. Deslocamentos negativos movem os bits para a esquerda.'
bit32.rshift =
[[
Retorna o número `x` deslocado `disp` bits para a direita. Deslocamentos negativos movem os bits para a esquerda. Em ambas as direções, os bits vazios são preenchidos com zeros.
```lua
assert(bit32.rshift(b, disp) ==
math.floor(b % 2^32 / 2^disp))
```
]]
coroutine =
''
coroutine.create =
'Cria uma nova `coroutine`, a partir de uma função `f` e retorna esta coroutine como objeto do tipo `"thread"`.'
coroutine.isyieldable =
'Retorna verdadeiro quando a `coroutine` em execução for finalizada.'
coroutine.isyieldable['>5.4']=
'Retorna verdadeiro quando a `coroutine` `co` for finalizada. Por padrão `co` é uma coroutine em execução.'
coroutine.close =
'Finaliza a coroutine `co` , encerrando todas as variáveis pendentes e colocando a coroutine em um estado morto.'
coroutine.resume =
'Inicia ou continua a execução da coroutine `co`.'
coroutine.running =
'Retorna a `coroutine` corrente e um booleana verdadeiro quando a coroutine corrente é a principal.'
coroutine.status =
'Retorna o status da `coroutine `co`.'
coroutine.wrap =
'Cria uma nova `coroutine`, a partir de uma função `f` e retorna uma função que retorna a coroutine cada vez que ele é chamado.'
coroutine.yield =
'Suspende a execução da coroutine chamada.'
costatus.running =
'Está em execução.'
costatus.suspended =
'Está suspenso ou não foi iniciado.'
costatus.normal =
'Está ativo, mas não está em execução.'
costatus.dead =
'Terminou ou parou devido a erro'
debug =
''
debug.debug =
'Entra em modo interativo com o usuário, executando os comandos de entrada.'
debug.getfenv =
'Retorna o ambiente do objeto `o` .'
debug.gethook =
'Retorna as configurações do `hook` atual da `thread`.'
debug.getinfo =
'Retorna uma tabela com informações sobre uma função.'
debug.getlocal['<5.1'] =
'Retorna o nome e o valor da variável local com índice `local` da função de nível `level` da pilha.'
debug.getlocal['>5.2'] =
'Retorna o nome e o valor da variável local com índice `local` da função de nível `f` da pilha.'
debug.getmetatable =
'Retorna a `metatable` do valor dado.'
debug.getregistry =
'Retorna a tabela de registro.'
debug.getupvalue =
'Retorna o nome e o valor da variável antecedente com índice `up` da função.'
debug.getuservalue['<5.3'] =
'Retorna o valor de Lua associado a `u` (i.e., user).'
debug.getuservalue['>5.4'] =
[[
Retorna o `n`-ésimo valor de usuário associado
aos dados do usuário `u` e um booleano,
`false`, se nos dados do usuário não existir esse valor.
]]
debug.setcstacklimit =
[[
### **Deprecated in `Lua 5.4.2`**
Estabelece um novo limite para a pilha C. Este limite controla quão profundamente as chamadas aninhadas podem ir em Lua, com a intenção de evitar um transbordamento da pilha.
Em caso de sucesso, esta função retorna o antigo limite. Em caso de erro, ela retorna `false`.
]]
debug.setfenv =
'Define o ambiente do `object` dado para a `table` dada .'
debug.sethook =
'Define a função dada como um `hook`.'
debug.setlocal =
'Atribui o valor `value` à variável local com índice `local` da função de nível `level` da pilha.'
debug.setmetatable =
'Define a `metatable` com o valor dado para tabela dada (que pode ser `nil`).'
debug.setupvalue =
'Atribui `value` a variável antecedente com índice `up` da função.'
debug.setuservalue['<5.3'] =
'Define o valor dado como o valor Lua associado ao `udata` (i.e., user data).'
debug.setuservalue['>5.4'] =
[[
Define o valor dado como
o `n`-ésimo valor de usuário associado ao `udata` (i.e., user data).
O `udata` deve ser um dado de usuário completo.
]]
debug.traceback =
'Retorna uma string com um `traceback` de chamadas. A string de mensagen (opcional) é anexada no início do traceback.'
debug.upvalueid =
'Retorna um identificador único (como um dado de usuário leve) para o valor antecedente de numero `n` da função dada.'
debug.upvaluejoin =
'Faz o `n1`-ésimo valor da função `f1` (i.e., closure Lua) referir-se ao `n2`-ésimo valor da função `f2`.'
infowhat.n =
'`name` e `namewhat`'
infowhat.S =
'`source`, `short_src`, `linedefined`, `lastlinedefined` e `what`'
infowhat.l =
'`currentline`'
infowhat.t =
'`istailcall`'
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
'`nups`, `nparams` e `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
'`ftransfer` e `ntransfer`'
infowhat.L =
'`activelines`'
hookmask.c =
'Faz chamada a um `hook` quando o Lua chama uma função.'
hookmask.r =
'Faz chamada a um `hook` quando o retorno de uma função é executado.'
hookmask.l =
'Faz chamada a um `hook` quando encontra nova linha de código.'
file =
''
file[':close'] =
'Fecha o arquivo `file`.'
file[':flush'] =
'Salva qualquer dado de entrada no arquivo `file`.'
file[':lines'] =
[[
------
```lua
for c in file:lines(...) do
body
end
```
]]
file[':read'] =
'Lê o arquivo de acordo com o formato fornecido e que especifica o que deve ser lido.'
file[':seek'] =
'Define e obtém a posição do arquivo, medida a partir do início do arquivo.'
file[':setvbuf'] =
'Define o modo de `buffer` para um arquivo de saída.'
file[':write'] =
'Escreve o valor de cada um de seus argumentos no arquivo.'
readmode.n =
'Lê um numeral e o devolve como número.'
readmode.a =
'Lê o arquivo completo.'
readmode.l =
'Lê a próxima linha pulando o final da linha.'
readmode.L =
'Lê a próxima linha mantendo o final da linha.'
seekwhence.set =
'O cursor base é o início do arquivo.'
seekwhence.cur =
'O cursor base é a posição atual.'
seekwhence['.end'] =
'O cursor base é o final do arquivo.'
vbuf.no =
'A saída da operação aparece imediatamente.'
vbuf.full =
'Realizado apenas quando o `buffer` está cheio.'
vbuf.line =
'`Buffered` até que uma nova linha seja encontrada.'
io =
''
io.stdin =
'Entrada padrão.'
io.stdout =
'Saída padrão.'
io.stderr =
'Erro padrão.'
io.close =
'Fecha o arquivo dado ou o arquivo de saída padrão.'
io.flush =
'Salva todos os dados gravados no arquivo de saída padrão.'
io.input =
'Define o arquivo de entrada padrão.'
io.lines =
[[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
io.open =
'Abre um arquivo no modo especificado pela *string* `mode`.'
io.output =
'Define o arquivo de saída padrão.'
io.popen =
'Inicia o programa dado em um processo separado.'
io.read =
'Lê o arquivo de acordo com o formato fornecido e que especifica o que deve ser lido.'
io.tmpfile =
'Em caso de sucesso, retorna um `handler` para um arquivo temporário.'
io.type =
'Verifica se `obj` é um identificador de arquivo válido.'
io.write =
'Escreve o valor de cada um dos seus argumentos para o arquivo de saída padrão.'
openmode.r =
'Modo de leitura.'
openmode.w =
'Modo de escrita.'
openmode.a =
'Modo de anexação.'
openmode['.r+'] =
'Modo de atualização, todos os dados anteriores são preservados.'
openmode['.w+'] =
'Modo de atualização, todos os dados anteriores são apagados.'
openmode['.a+'] =
'Modo de anexação e atualização, os dados anteriores são preservados, a escrita só é permitida no final do arquivo.'
openmode.rb =
'Modo de leitura. (em modo binário)'
openmode.wb =
'Modo de escrita. (em modo binário)'
openmode.ab =
'Modo de anexação. (em modo binário)'
openmode['.r+b'] =
'Modo de atualização, todos os dados anteriores são preservados. (em modo binário)'
openmode['.w+b'] =
'Modo de atualização, todos os dados anteriores são apagados. (em modo binário)'
openmode['.a+b'] =
'Modo de anexação e atualização, todos os dados anteriores são preservados, a escrita só é permitida no final do arquivo. (em modo binário)'
popenmode.r =
'Leia dados deste programa pelo arquivo.'
popenmode.w =
'Escreva dados neste programa pelo arquivo.'
filetype.file =
'`handler` para arquivo aberto.'
filetype['.closed file'] =
'`handler` para arquivo fechado.'
filetype['.nil'] =
'Não é um `handler` de arquivo'
math =
''
math.abs =
'Retorna o valor absoluto de `x`.'
math.acos =
'Retorna o arco cosseno de `x` (em radianos).'
math.asin =
'Retorna o arco seno de `x` (em radianos).'
math.atan['<5.2'] =
'Retorna o arco tangente de `x` (em radianos).'
math.atan['>5.3'] =
'Retorna o arco tangente de `y/x` (em radianos).'
math.atan2 =
'Retorna o arco tangente de `y/x` (em radianos).'
math.ceil =
'Retorna o menor valor inteiro maior ou igual a `x`.'
math.cos =
'Retorna o cosseno de `x` (requer valor em radianos).'
math.cosh =
'Retorna o cosseno hiperbólico de `x` (requer valor em radianos).'
math.deg =
'Converte o ângulo `x` de radianos para graus.'
math.exp =
'Retorna o valor `e^x` (onde `e` é a base do logaritmo natural).'
math.floor =
'Retorna o maior valor inteiro menor ou igual a `x`.'
math.fmod =
'Retorna o resto da divisão de `x` por `y` que arredonda o quociente para zero.'
math.frexp =
'Decompõe `x` em fatores e expoentes. Retorna `m` e `e` tal que `x = m * (2 ^ e)` é um inteiro e o valor absoluto de `m` está no intervalo [0,5, 1) (ou zero quando `x` é zero).'
math.huge =
'Um valor maior que qualquer outro valor numérico.'
math.ldexp =
'Retorna `m * (2 ^ e)`.'
math.log['<5.1'] =
'Retorna o logaritmo natural de `x`.'
math.log['>5.2'] =
'Retorna o logaritmo de `x` na base dada.'
math.log10 =
'Retorna o logaritmo `x` na base 10.'
math.max =
'Retorna o argumento com o valor máximo de acordo com o operador `<`.'
math.maxinteger['>5.3'] =
'Retorna o valor máximo para um inteiro.'
math.min =
'Retorna o argumento com o valor mínimo de acordo com o operador `<`.'
math.mininteger['>5.3'] =
'Retorna o valor mínimo para um inteiro.'
math.modf =
'Retorna a parte inteira e a parte fracionária de `x`.'
math.pi =
'O valor de *π*.'
math.pow =
'Retorna `x ^ y`.'
math.rad =
'Converte o ângulo `x` de graus para radianos.'
math.random =
[[
* `math.random()`: Retorna um valor real (i.e., ponto flutuante) no intervalo [0,1).
* `math.random(n)`: Retorna um inteiro no intervalo [1, n].
* `math.random(m, n)`: Retorna um inteiro no intervalo [m, n].
]]
math.randomseed['<5.3'] =
'Define `x` como valor semente (i.e., `seed`) para a função geradora de números pseudo-aleatória.'
math.randomseed['>5.4'] =
[[
* `math.randomseed(x, y)`: Concatena `x` e `y` em um espaço de 128-bits que é usado como valor semente (`seed`) para reinicializar o gerador de números pseudo-aleatório.
* `math.randomseed(x)`: Equivale a `math.randomseed(x, 0)` .
* `math.randomseed()`: Gera um valor semente (i.e., `seed`) com fraca probabilidade de aleatoriedade.
]]
math.sin =
'Retorna o seno de `x` (requer valor em radianos).'
math.sinh =
'Retorna o seno hiperbólico de `x` (requer valor em radianos).'
math.sqrt =
'Retorna a raiz quadrada de `x`.'
math.tan =
'Retorna a tangente de `x` (requer valor em radianos).'
math.tanh =
'Retorna a tangente hiperbólica de `x` (requer valor em radianos).'
math.tointeger['>5.3'] =
'Se o valor `x` pode ser convertido para um inteiro, retorna esse inteiro.'
math.type['>5.3'] =
'Retorna `"integer"` se `x` é um inteiro, `"float"` se for um valor real (i.e., ponto flutuante), ou `nil` se `x` não é um número.'
math.ult['>5.3'] =
'Retorna `true` se e somente se `m` é menor `n` quando eles são comparados como inteiros sem sinal.'
os =
''
os.clock =
'Retorna uma aproximação do valor, em segundos, do tempo de CPU usado pelo programa.'
os.date =
'Retorna uma string ou uma tabela contendo data e hora, formatada de acordo com a string `format` fornecida.'
os.difftime =
'Retorna a diferença, em segundos, do tempo `t1` para o tempo` t2`.'
os.execute =
'Passa `command` para ser executado por um `shell` do sistema operacional.'
os.exit['<5.1'] =
'Chama a função `exit` do C para encerrar o programa.'
os.exit['>5.2'] =
'Chama a função `exit` do ISO C para encerrar o programa.'
os.getenv =
'Retorna o valor da variável de ambiente de processo `varname`.'
os.remove =
'Remove o arquivo com o nome dado.'
os.rename =
'Renomeia o arquivo ou diretório chamado `oldname` para `newname`.'
os.setlocale =
'Define a localidade atual do programa.'
os.time =
'Retorna a hora atual quando chamada sem argumentos, ou um valor representando a data e a hora local especificados pela tabela fornecida.'
os.tmpname =
'Retorna uma string com um nome de arquivo que pode ser usado como arquivo temporário.'
osdate.year =
'Quatro dígitos.'
osdate.month =
'1-12'
osdate.day =
'1-31'
osdate.hour =
'0-23'
osdate.min =
'0-59'
osdate.sec =
'0-61'
osdate.wday =
'Dia da semana, 17, Domingo é 1'
osdate.yday =
'Dia do ano, 1366'
osdate.isdst =
'Bandeira para indicar horário de verão (i.e., `Daylight Saving Time`), um valor booleano.'
package =
''
require['<5.3'] =
'Carrega o módulo fornecido e retorna qualquer valor retornado pelo módulo (`true` quando `nil`).'
require['>5.4'] =
'Carrega o módulo fornecido e retorna qualquer valor retornado pelo pesquisador (`true` quando `nil`). Além desse valor, também retorna como segundo resultado um carregador de dados retornados pelo pesquisador, o que indica como `require` encontrou o módulo. (Por exemplo, se o módulo vier de um arquivo, este carregador de dados é o caminho do arquivo.)'
package.config =
'string descrevendo configurações a serem utilizadas durante a compilação de pacotes.'
package.cpath =
'O caminho usado pelo `require` para procurar pelo carregador C.'
package.loaded =
'Uma tabela usada pelo `require` para controlar quais módulos já estão carregados.'
package.loaders =
'Uma tabela usada pelo `require` para controlar como carregar módulos.'
package.loadlib =
'Dinamicamente vincula o programa no `host` com a biblioteca C `libname`.'
package.path =
'O caminho usado pelo `require` para procurar por um carregador Lua.'
package.preload =
'Uma tabela para armazenar carregadores de módulos específicos.'
package.searchers =
'Uma tabela usada pelo `require` para controlar como buscar módulos.'
package.searchpath =
'Procura por `name` em `path`.'
package.seeall =
'Define uma `metatable` `module` com o campo `__index` referenciando o ambiente global, para que este módulo herde valores do ambiente global. Para ser usado como uma opção a função `module`.'
string =
''
string.byte =
'Retorna os códigos numéricos internos dos caracteres `s[i], s[i+1], ..., s[j]`.'
string.char =
'Retorna uma string com comprimento igual ao número de argumentos, no qual cada caractere possui o código numérico interno igual ao seu argumento correspondente.'
string.dump =
'Retorna uma string contendo uma representação binária (i.e., *binary chunk*) da função dada.'
string.find =
'Procura a primeira correspondencia de `pattern` (veja §6.4.1) na string.'
string.format =
'Retorna uma versão formatada de seu número variável de argumentos após a descrição dada em seu primeiro argumento.'
string.gmatch =
[[
Retorna um iterator que, a cada vez que é chamado, retorna as próximas capturas de `pattern` (veja §6.4.1) sobre a string *s*.
Por exemplo, o loop a seguir irá iterar em todas as palavras da string *s*, imprimindo cada palavra por linha:
```lua
s =
"hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gsub =
'Retorna uma cópia da *s* em que todas ou, caso fornecido, as primeiras `n` ocorrências de `pattern` (veja §6.4.1) que tiverem sido substituídas por uma string de substituição especificada por `repl`.'
string.len =
'Retorna o comprimento da string.'
string.lower =
'Retorna uma cópia desta string com todas as letras maiúsculas alteradas para minúsculas.'
string.match =
'Procura a primeira ocorrência do `pattern` (veja §6.4.1) na string.'
string.pack =
'Retorna uma string binária contendo os valores `V1`, `v2`, etc. empacotados (isto é, serializado de forma binário) de acordo com o formato da string `fmt` fornecida (veja §6.4.2).'
string.packsize =
'Retorna o tamanho de uma string resultante de `string.pack` com o formato da string `fmt` fornecida (veja §6.4.2).'
string.rep['>5.2'] =
'Retorna uma string que é a concatenação de `n` cópias da string `s` separadas pela string `sep`.'
string.rep['<5.1'] =
'Retorna uma string que é a concatenação de `n` cópias da string `s`.'
string.reverse =
'Retorna uma string que representa a string `s` invertida.'
string.sub =
'Retorna a substring da string `s` que começa no índice `i` e continua até o índice `j`.'
string.unpack =
'Retorna os valores empacotados na string de acordo com o formato da string `fmt` fornecida (veja §6.4.2).'
string.upper =
'Retorna uma cópia desta string com todas as letras minúsculas alteradas para maiúsculas.'
table =
''
table.concat =
'Dada uma lista onde todos os elementos são strings ou números, retorna a string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
table.insert =
'Insere o elemento `value` na posição `pos` de `list`.'
table.maxn =
'Retorna o maior índice numérico positivo da tabela fornecida ou zero se a tabela não tiver índices numéricos positivos.'
table.move =
[[
Move os elementos da tabela `a1` para tabela `a2`.
```lua
a2[t],··· =
a1[f],···,a1[e]
return a2
```
]]
table.pack =
'Retorna uma nova tabela com todos os argumentos armazenados em chaves `1`, `2`, etc. e com um campo `"n"` com o número total de argumentos.'
table.remove =
'Remove de `list` o elemento na posição `pos`, retornando o valor do elemento removido.'
table.sort =
'Ordena os elementos de `list` em uma determinada ordem, *in-place*, de `list[1]` para `list[#list]`.'
table.unpack =
[[
Retorna os elementos da lista fornecida. Esta função é equivalente a
```lua
return list[i], list[i+1], ···, list[j]
```
Por padrão, `i` é `1` e `j` é `#list`.
]]
table.foreach = -- TODO: need translate!
'Executes the given f over all elements of table. For each element, f is called with the index and respective value as arguments. If f returns a non-nil value, then the loop is broken, and this value is returned as the final value of foreach.'
table.foreachi = -- TODO: need translate!
'Executes the given f over the numerical indices of table. For each index, f is called with the index and respective value as arguments. Indices are visited in sequential order, from 1 to n, where n is the size of the table. If f returns a non-nil value, then the loop is broken and this value is returned as the result of foreachi.'
table.getn = -- TODO: need translate!
'Returns the number of elements in the table. This function is equivalent to `#list`.'
table.new = -- TODO: need translate!
[[This creates a pre-sized table, just like the C API equivalent `lua_createtable()`. This is useful for big tables if the final table size is known and automatic table resizing is too expensive. `narray` parameter specifies the number of array-like items, and `nhash` parameter specifies the number of hash-like items. The function needs to be required before use.
```lua
require("table.new")
```
]]
table.clear = -- TODO: need translate!
[[This clears all keys and values from a table, but preserves the allocated array/hash sizes. This is useful when a table, which is linked from multiple places, needs to be cleared and/or when recycling a table for use by the same context. This avoids managing backlinks, saves an allocation and the overhead of incremental array/hash part growth. The function needs to be required before use.
```lua
require("table.clear").
```
Please note this function is meant for very specific situations. In most cases it's better to replace the (usually single) link with a new table and let the GC do its work.
]]
utf8 =
''
utf8.char =
'Recebe zero ou mais inteiros, converte cada um à sua sequência de byte UTF-8 correspondente e retorna uma string com a concatenação de todas essas sequências.'
utf8.charpattern =
'O padrão que corresponde exatamente uma sequência de byte UTF-8, supondo que seja uma sequência válida UTF-8.'
utf8.codes =
[[
Retorna valores tal que a seguinte construção
```lua
for p, c in utf8.codes(s) do
body
end
```
itere em todos os caracteres UTF-8 na string s, com p sendo a posição (em bytes) e c o *codepoint* de cada caractere. Ele gera um erro se encontrado qualquer sequência de byte inválida.
]]
utf8.codepoint =
'Retorna os *codepoints* (em inteiros) de todos os caracteres em `s` que iniciam entre as posições do byte `i` e `j` (ambos inclusos).'
utf8.len =
'Retorna o número de caracteres UTF-8 na string `s` que começa entre as posições `i` e `j` (ambos inclusos).'
utf8.offset =
'Retorna a posição (em bytes) onde a codificação do `n`-ésimo caractere de `s` inícia (contando a partir da posição `i`).'

View File

@@ -0,0 +1,480 @@
---@diagnostic disable: undefined-global
config.addonManager.enable = -- TODO: need translate!
"Whether the addon manager is enabled or not."
config.addonManager.repositoryBranch = -- TODO: need translate!
"Specifies the git branch used by the addon manager."
config.addonManager.repositoryPath = -- TODO: need translate!
"Specifies the git path used by the addon manager."
config.addonRepositoryPath = -- TODO: need translate!
"Specifies the addon repository path (not related to the addon manager)."
config.runtime.version = -- TODO: need translate!
"Lua runtime version."
config.runtime.path = -- TODO: need translate!
[[
When using `require`, how to find the file based on the input name.
Setting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.
if `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.
If you want to load files outside the workspace, you need to set `Lua.workspace.library` first.
]]
config.runtime.pathStrict = -- TODO: need translate!
'When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`.'
config.runtime.special = -- TODO: need translate!
[[The custom global variables are regarded as some special built-in variables, and the language server will provide special support
The following example shows that 'include' is treated as' require '.
```json
"Lua.runtime.special" : {
"include" : "require"
}
```
]]
config.runtime.unicodeName = -- TODO: need translate!
"Allows Unicode characters in name."
config.runtime.nonstandardSymbol = -- TODO: need translate!
"Supports non-standard symbols. Make sure that your runtime environment supports these symbols."
config.runtime.plugin = -- TODO: need translate!
"Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more."
config.runtime.pluginArgs = -- TODO: need translate!
"Additional arguments for the plugin."
config.runtime.fileEncoding = -- TODO: need translate!
"File encoding. The `ansi` option is only available under the `Windows` platform."
config.runtime.builtin = -- TODO: need translate!
[[
Adjust the enabled state of the built-in library. You can disable (or redefine) the non-existent library according to the actual runtime environment.
* `default`: Indicates that the library will be enabled or disabled according to the runtime version
* `enable`: always enable
* `disable`: always disable
]]
config.runtime.meta = -- TODO: need translate!
'Format of the directory name of the meta files.'
config.diagnostics.enable = -- TODO: need translate!
"Enable diagnostics."
config.diagnostics.disable = -- TODO: need translate!
"Disabled diagnostic (Use code in hover brackets)."
config.diagnostics.globals = -- TODO: need translate!
"Defined global variables."
config.diagnostics.globalsRegex = -- TODO: need translate!
"Find defined global variables using regex."
config.diagnostics.severity = -- TODO: need translate!
[[
Modify the diagnostic severity.
End with `!` means override the group setting `diagnostics.groupSeverity`.
]]
config.diagnostics.neededFileStatus = -- TODO: need translate!
[[
* Opened: only diagnose opened files
* Any: diagnose all files
* None: disable this diagnostic
End with `!` means override the group setting `diagnostics.groupFileStatus`.
]]
config.diagnostics.groupSeverity = -- TODO: need translate!
[[
Modify the diagnostic severity in a group.
`Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` separately.
Other settings will override individual settings without end of `!`.
]]
config.diagnostics.groupFileStatus = -- TODO: need translate!
[[
Modify the diagnostic needed file status in a group.
* Opened: only diagnose opened files
* Any: diagnose all files
* None: disable this diagnostic
`Fallback` means that diagnostics in this group are controlled by `diagnostics.neededFileStatus` separately.
Other settings will override individual settings without end of `!`.
]]
config.diagnostics.workspaceEvent = -- TODO: need translate!
"Set the time to trigger workspace diagnostics."
config.diagnostics.workspaceEvent.OnChange = -- TODO: need translate!
"Trigger workspace diagnostics when the file is changed."
config.diagnostics.workspaceEvent.OnSave = -- TODO: need translate!
"Trigger workspace diagnostics when the file is saved."
config.diagnostics.workspaceEvent.None = -- TODO: need translate!
"Disable workspace diagnostics."
config.diagnostics.workspaceDelay = -- TODO: need translate!
"Latency (milliseconds) for workspace diagnostics."
config.diagnostics.workspaceRate = -- TODO: need translate!
"Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also reduces the speed of workspace diagnostics. The diagnosis of the file you are currently editing is always done at full speed and is not affected by this setting."
config.diagnostics.libraryFiles = -- TODO: need translate!
"How to diagnose files loaded via `Lua.workspace.library`."
config.diagnostics.libraryFiles.Enable = -- TODO: need translate!
"Always diagnose these files."
config.diagnostics.libraryFiles.Opened = -- TODO: need translate!
"Only when these files are opened will it be diagnosed."
config.diagnostics.libraryFiles.Disable = -- TODO: need translate!
"These files are not diagnosed."
config.diagnostics.ignoredFiles = -- TODO: need translate!
"How to diagnose ignored files."
config.diagnostics.ignoredFiles.Enable = -- TODO: need translate!
"Always diagnose these files."
config.diagnostics.ignoredFiles.Opened = -- TODO: need translate!
"Only when these files are opened will it be diagnosed."
config.diagnostics.ignoredFiles.Disable = -- TODO: need translate!
"These files are not diagnosed."
config.diagnostics.disableScheme = -- TODO: need translate!
'Do not diagnose Lua files that use the following scheme.'
config.diagnostics.unusedLocalExclude = -- TODO: need translate!
'Do not diagnose `unused-local` when the variable name matches the following pattern.'
config.workspace.ignoreDir = -- TODO: need translate!
"Ignored files and directories (Use `.gitignore` grammar)."-- .. example.ignoreDir,
config.workspace.ignoreSubmodules = -- TODO: need translate!
"Ignore submodules."
config.workspace.useGitIgnore = -- TODO: need translate!
"Ignore files list in `.gitignore` ."
config.workspace.maxPreload = -- TODO: need translate!
"Max preloaded files."
config.workspace.preloadFileSize = -- TODO: need translate!
"Skip files larger than this value (KB) when preloading."
config.workspace.library = -- TODO: need translate!
"In addition to the current workspace, which directories will load files from. The files in these directories will be treated as externally provided code libraries, and some features (such as renaming fields) will not modify these files."
config.workspace.checkThirdParty = -- TODO: need translate!
[[
Automatic detection and adaptation of third-party libraries, currently supported libraries are:
* OpenResty
* Cocos4.0
* LÖVE
* LÖVR
* skynet
* Jass
]]
config.workspace.userThirdParty = -- TODO: need translate!
'Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd)'
config.workspace.supportScheme = -- TODO: need translate!
'Provide language server for the Lua files of the following scheme.'
config.completion.enable = -- TODO: need translate!
'Enable completion.'
config.completion.callSnippet = -- TODO: need translate!
'Shows function call snippets.'
config.completion.callSnippet.Disable = -- TODO: need translate!
"Only shows `function name`."
config.completion.callSnippet.Both = -- TODO: need translate!
"Shows `function name` and `call snippet`."
config.completion.callSnippet.Replace = -- TODO: need translate!
"Only shows `call snippet.`"
config.completion.keywordSnippet = -- TODO: need translate!
'Shows keyword syntax snippets.'
config.completion.keywordSnippet.Disable = -- TODO: need translate!
"Only shows `keyword`."
config.completion.keywordSnippet.Both = -- TODO: need translate!
"Shows `keyword` and `syntax snippet`."
config.completion.keywordSnippet.Replace = -- TODO: need translate!
"Only shows `syntax snippet`."
config.completion.displayContext = -- TODO: need translate!
"Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled."
config.completion.workspaceWord = -- TODO: need translate!
"Whether the displayed context word contains the content of other files in the workspace."
config.completion.showWord = -- TODO: need translate!
"Show contextual words in suggestions."
config.completion.showWord.Enable = -- TODO: need translate!
"Always show context words in suggestions."
config.completion.showWord.Fallback = -- TODO: need translate!
"Contextual words are only displayed when suggestions based on semantics cannot be provided."
config.completion.showWord.Disable = -- TODO: need translate!
"Do not display context words."
config.completion.autoRequire = -- TODO: need translate!
"When the input looks like a file name, automatically `require` this file."
config.completion.showParams = -- TODO: need translate!
"Display parameters in completion list. When the function has multiple definitions, they will be displayed separately."
config.completion.requireSeparator = -- TODO: need translate!
"The separator used when `require`."
config.completion.postfix = -- TODO: need translate!
"The symbol used to trigger the postfix suggestion."
config.color.mode = -- TODO: need translate!
"Color mode."
config.color.mode.Semantic = -- TODO: need translate!
"Semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect."
config.color.mode.SemanticEnhanced = -- TODO: need translate!
"Enhanced semantic color. Like `Semantic`, but with additional analysis which might be more computationally expensive."
config.color.mode.Grammar = -- TODO: need translate!
"Grammar color."
config.semantic.enable = -- TODO: need translate!
"Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect."
config.semantic.variable = -- TODO: need translate!
"Semantic coloring of variables/fields/parameters."
config.semantic.annotation = -- TODO: need translate!
"Semantic coloring of type annotations."
config.semantic.keyword = -- TODO: need translate!
"Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring."
config.signatureHelp.enable = -- TODO: need translate!
"Enable signature help."
config.hover.enable = -- TODO: need translate!
"Enable hover."
config.hover.viewString = -- TODO: need translate!
"Hover to view the contents of a string (only if the literal contains an escape character)."
config.hover.viewStringMax = -- TODO: need translate!
"The maximum length of a hover to view the contents of a string."
config.hover.viewNumber = -- TODO: need translate!
"Hover to view numeric content (only if literal is not decimal)."
config.hover.fieldInfer = -- TODO: need translate!
"When hovering to view a table, type infer will be performed for each field. When the accumulated time of type infer reaches the set value (MS), the type infer of subsequent fields will be skipped."
config.hover.previewFields = -- TODO: need translate!
"When hovering to view a table, limits the maximum number of previews for fields."
config.hover.enumsLimit = -- TODO: need translate!
"When the value corresponds to multiple types, limit the number of types displaying."
config.hover.expandAlias = -- TODO: need translate!
[[
Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.
]]
config.develop.enable = -- TODO: need translate!
'Developer mode. Do not enable, performance will be affected.'
config.develop.debuggerPort = -- TODO: need translate!
'Listen port of debugger.'
config.develop.debuggerWait = -- TODO: need translate!
'Suspend before debugger connects.'
config.intelliSense.searchDepth = -- TODO: need translate!
'Set the search depth for IntelliSense. Increasing this value increases accuracy, but decreases performance. Different workspace have different tolerance for this setting. Please adjust it to the appropriate value.'
config.intelliSense.fastGlobal = -- TODO: need translate!
'In the global variable completion, and view `_G` suspension prompt. This will slightly reduce the accuracy of type speculation, but it will have a significant performance improvement for projects that use a lot of global variables.'
config.window.statusBar = -- TODO: need translate!
'Show extension status in status bar.'
config.window.progressBar = -- TODO: need translate!
'Show progress bar in status bar.'
config.hint.enable = -- TODO: need translate!
'Enable inlay hint.'
config.hint.paramType = -- TODO: need translate!
'Show type hints at the parameter of the function.'
config.hint.setType = -- TODO: need translate!
'Show hints of type at assignment operation.'
config.hint.paramName = -- TODO: need translate!
'Show hints of parameter name at the function call.'
config.hint.paramName.All = -- TODO: need translate!
'All types of parameters are shown.'
config.hint.paramName.Literal = -- TODO: need translate!
'Only literal type parameters are shown.'
config.hint.paramName.Disable = -- TODO: need translate!
'Disable parameter hints.'
config.hint.arrayIndex = -- TODO: need translate!
'Show hints of array index when constructing a table.'
config.hint.arrayIndex.Enable = -- TODO: need translate!
'Show hints in all tables.'
config.hint.arrayIndex.Auto = -- TODO: need translate!
'Show hints only when the table is greater than 3 items, or the table is a mixed table.'
config.hint.arrayIndex.Disable = -- TODO: need translate!
'Disable hints of array index.'
config.hint.await = -- TODO: need translate!
'If the called function is marked `---@async`, prompt `await` at the call.'
config.hint.awaitPropagate = -- TODO: need translate!
'Enable the propagation of `await`. When a function calls a function marked `---@async`,\z
it will be automatically marked as `---@async`.'
config.hint.semicolon = -- TODO: need translate!
'If there is no semicolon at the end of the statement, display a virtual semicolon.'
config.hint.semicolon.All = -- TODO: need translate!
'All statements display virtual semicolons.'
config.hint.semicolon.SameLine = -- TODO: need translate!
'When two statements are on the same line, display a semicolon between them.'
config.hint.semicolon.Disable = -- TODO: need translate!
'Disable virtual semicolons.'
config.codeLens.enable = -- TODO: need translate!
'Enable code lens.'
config.format.enable = -- TODO: need translate!
'Enable code formatter.'
config.format.defaultConfig = -- TODO: need translate!
[[
The default format configuration. Has a lower priority than `.editorconfig` file in the workspace.
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.spell.dict = -- TODO: need translate!
'Custom words for spell checking.'
config.nameStyle.config = -- TODO: need translate!
[[
Set name style config.
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.telemetry.enable = -- TODO: need translate!
[[
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).
]]
config.misc.parameters = -- TODO: need translate!
'[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language service in VSCode.'
config.misc.executablePath = -- TODO: need translate!
'Specify the executable path in VSCode.'
config.language.fixIndent = -- TODO: need translate!
'(VSCode only) Fix incorrect auto-indentation, such as incorrect indentation when line breaks occur within a string containing the word "function."'
config.language.completeAnnotation = -- TODO: need translate!
'(VSCode only) Automatically insert "---@ " after a line break following a annotation.'
config.type.castNumberToInteger = -- TODO: need translate!
'Allowed to assign the `number` type to the `integer` type.'
config.type.weakUnionCheck = -- TODO: need translate!
[[
Once one subtype of a union type meets the condition, the union type also meets the condition.
When this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.
]]
config.type.weakNilCheck = -- TODO: need translate!
[[
When checking the type of union type, ignore the `nil` in it.
When this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.
]]
config.type.inferParamType = -- TODO: need translate!
[[
When the parameter type is not annotated, the parameter type is inferred from the function's incoming parameters.
When this setting is `false`, the type of the parameter is `any` when it is not annotated.
]]
config.type.checkTableShape = -- TODO: need translate!
[[
对表的形状进行严格检查。
]]
config.type.inferTableSize = -- TODO: need translate!
'Maximum number of table fields analyzed during type inference.'
config.doc.privateName = -- TODO: need translate!
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
config.doc.protectedName = -- TODO: need translate!
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
config.doc.packageName = -- TODO: need translate!
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
config.doc.regengine = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.doc.regengine.glob = -- TODO: need translate!
'The default lightweight pattern syntax.'
config.doc.regengine.lua = -- TODO: need translate!
'Full Lua-style regular expressions.'
config.docScriptPath = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.diagnostics['unused-local'] = -- TODO: need translate!
'未使用的局部变量'
config.diagnostics['unused-function'] = -- TODO: need translate!
'未使用的函数'
config.diagnostics['undefined-global'] = -- TODO: need translate!
'未定义的全局变量'
config.diagnostics['global-in-nil-env'] = -- TODO: need translate!
'不能使用全局变量( `_ENV` 被设置为了 `nil`'
config.diagnostics['unused-label'] = -- TODO: need translate!
'未使用的标签'
config.diagnostics['unused-vararg'] = -- TODO: need translate!
'未使用的不定参数'
config.diagnostics['trailing-space'] = -- TODO: need translate!
'后置空格'
config.diagnostics['redefined-local'] = -- TODO: need translate!
'重复定义的局部变量'
config.diagnostics['newline-call'] = -- TODO: need translate!
'以 `(` 开始的新行,在语法上被解析为了上一行的函数调用'
config.diagnostics['newfield-call'] = -- TODO: need translate!
'在字面量表中2行代码之间缺少分隔符在语法上被解析为了一次索引操作'
config.diagnostics['redundant-parameter'] = -- TODO: need translate!
'函数调用时,传入了多余的参数'
config.diagnostics['ambiguity-1'] = -- TODO: need translate!
'优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` '
config.diagnostics['lowercase-global'] = -- TODO: need translate!
'首字母小写的全局变量定义'
config.diagnostics['undefined-env-child'] = -- TODO: need translate!
'`_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中'
config.diagnostics['duplicate-index'] = -- TODO: need translate!
'在字面量表中重复定义了索引'
config.diagnostics['empty-block'] = -- TODO: need translate!
'空代码块'
config.diagnostics['redundant-value'] = -- TODO: need translate!
'赋值操作时,值的数量比被赋值的对象多'
config.diagnostics['assign-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.'
config.diagnostics['await-in-sync'] = -- TODO: need translate!
'Enable diagnostics for calls of asynchronous functions within a synchronous function.'
config.diagnostics['cast-local-type'] = -- TODO: need translate!
'Enable diagnostics for casts of local variables where the target type does not match the defined type.'
config.diagnostics['cast-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for casts where the target type does not match the initial type.'
config.diagnostics['circular-doc-class'] = -- TODO: need translate!
'Enable diagnostics for two classes inheriting from each other introducing a circular relation.'
config.diagnostics['close-non-object'] = -- TODO: need translate!
'Enable diagnostics for attempts to close a variable with a non-object.'
config.diagnostics['code-after-break'] = -- TODO: need translate!
'Enable diagnostics for code placed after a break statement in a loop.'
config.diagnostics['codestyle-check'] = -- TODO: need translate!
'Enable diagnostics for incorrectly styled lines.'
config.diagnostics['count-down-loop'] = -- TODO: need translate!
'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.'
config.diagnostics['deprecated'] = -- TODO: need translate!
'Enable diagnostics to highlight deprecated API.'
config.diagnostics['different-requires'] = -- TODO: need translate!
'Enable diagnostics for files which are required by two different paths.'
config.diagnostics['discard-returns'] = -- TODO: need translate!
'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.'
config.diagnostics['doc-field-no-class'] = -- TODO: need translate!
'Enable diagnostics to highlight a field annotation without a defining class annotation.'
config.diagnostics['duplicate-doc-alias'] = -- TODO: need translate!
'Enable diagnostics for a duplicated alias annotation name.'
config.diagnostics['duplicate-doc-field'] = -- TODO: need translate!
'Enable diagnostics for a duplicated field annotation name.'
config.diagnostics['duplicate-doc-param'] = -- TODO: need translate!
'Enable diagnostics for a duplicated param annotation name.'
config.diagnostics['duplicate-set-field'] = -- TODO: need translate!
'Enable diagnostics for setting the same field in a class more than once.'
config.diagnostics['incomplete-signature-doc'] = -- TODO: need translate!
'Incomplete @param or @return annotations for functions.'
config.diagnostics['invisible'] = -- TODO: need translate!
'Enable diagnostics for accesses to fields which are invisible.'
config.diagnostics['missing-global-doc'] = -- TODO: need translate!
'Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.'
config.diagnostics['missing-local-export-doc'] = -- TODO: need translate!
'Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.'
config.diagnostics['missing-parameter'] = -- TODO: need translate!
'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.'
config.diagnostics['missing-return'] = -- TODO: need translate!
'Enable diagnostics for functions with return annotations which have no return statement.'
config.diagnostics['missing-return-value'] = -- TODO: need translate!
'Enable diagnostics for return statements without values although the containing function declares returns.'
config.diagnostics['need-check-nil'] = -- TODO: need translate!
'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.'
config.diagnostics['unnecessary-assert'] = -- TODO: need translate!
'Enable diagnostics for redundant assertions on truthy values.'
config.diagnostics['no-unknown'] = -- TODO: need translate!
'Enable diagnostics for cases in which the type cannot be inferred.'
config.diagnostics['not-yieldable'] = -- TODO: need translate!
'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.'
config.diagnostics['param-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.'
config.diagnostics['redundant-return'] = -- TODO: need translate!
'Enable diagnostics for return statements which are not needed because the function would exit on its own.'
config.diagnostics['redundant-return-value']= -- TODO: need translate!
'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.'
config.diagnostics['return-type-mismatch'] = -- TODO: need translate!
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
config.diagnostics['spell-check'] = -- TODO: need translate!
'Enable diagnostics for typos in strings.'
config.diagnostics['name-style-check'] = -- TODO: need translate!
'Enable diagnostics for name style.'
config.diagnostics['unbalanced-assignments']= -- TODO: need translate!
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
config.diagnostics['undefined-doc-class'] = -- TODO: need translate!
'Enable diagnostics for class annotations in which an undefined class is referenced.'
config.diagnostics['undefined-doc-name'] = -- TODO: need translate!
'Enable diagnostics for type annotations referencing an undefined type or alias.'
config.diagnostics['undefined-doc-param'] = -- TODO: need translate!
'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.'
config.diagnostics['undefined-field'] = -- TODO: need translate!
'Enable diagnostics for cases in which an undefined field of a variable is read.'
config.diagnostics['unknown-cast-variable'] = -- TODO: need translate!
'Enable diagnostics for casts of undefined variables.'
config.diagnostics['unknown-diag-code'] = -- TODO: need translate!
'Enable diagnostics in cases in which an unknown diagnostics code is entered.'
config.diagnostics['unknown-operator'] = -- TODO: need translate!
'Enable diagnostics for unknown operators.'
config.diagnostics['unreachable-code'] = -- TODO: need translate!
'Enable diagnostics for unreachable code.'
config.diagnostics['global-element'] = -- TODO: need translate!
'Enable diagnostics to warn about global elements.'
config.typeFormat.config = -- TODO: need translate!
'Configures the formatting behavior while typing Lua code.'
config.typeFormat.config.auto_complete_end = -- TODO: need translate!
'Controls if `end` is automatically completed at suitable positions.'
config.typeFormat.config.auto_complete_table_sep = -- TODO: need translate!
'Controls if a separator is automatically appended at the end of a table declaration.'
config.typeFormat.config.format_line = -- TODO: need translate!
'Controls if a line is formatted at all.'
command.exportDocument = -- TODO: need translate!
'Lua: Export Document ...'
command.addon_manager.open = -- TODO: need translate!
'Lua: Open Addon Manager ...'
command.reloadFFIMeta = -- TODO: need translate!
'Lua: Reload luajit ffi meta'
command.startServer = -- TODO: need translate!
'Lua: Restart Language Server'
command.stopServer = -- TODO: need translate!
'Lua: Stop Language Server'

View File

@@ -0,0 +1,743 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
'独立版Lua的启动参数。'
assert =
'如果其参数 `v` 的值为假(`nil` 或 `false` 它就调用 $error 否则,返回所有的参数。 在错误情况时, `message` 指那个错误对象; 如果不提供这个参数,参数默认为 `"assertion failed!"` 。'
cgopt.collect =
'做一次完整的垃圾收集循环。'
cgopt.stop =
'停止垃圾收集器的运行。'
cgopt.restart =
'重启垃圾收集器的自动运行。'
cgopt.count =
'以 K 字节数为单位返回 Lua 使用的总内存数。'
cgopt.step =
'单步运行垃圾收集器。 步长“大小”由 `arg` 控制。'
cgopt.setpause =
'将 `arg` 设为收集器的 *间歇率* 。'
cgopt.setstepmul =
'将 `arg` 设为收集器的 *步进倍率* 。'
cgopt.incremental =
'改变收集器模式为增量模式。'
cgopt.generational =
'改变收集器模式为分代模式。'
cgopt.isrunning =
'返回表示收集器是否在工作的布尔值。'
collectgarbage =
'这个函数是垃圾收集器的通用接口。 通过参数 opt 它提供了一组不同的功能。'
dofile =
'打开该名字的文件,并执行文件中的 Lua 代码块。 不带参数调用时, `dofile` 执行标准输入的内容(`stdin`)。 返回该代码块的所有返回值。 对于有错误的情况,`dofile` 将错误反馈给调用者 (即,`dofile` 没有运行在保护模式下)。'
error =
[[
中止上一次保护函数调用, 将错误对象 `message` 返回。 函数 `error` 永远不会返回。
当 `message` 是一个字符串时,通常 `error` 会把一些有关出错位置的信息附加在消息的前头。 level 参数指明了怎样获得出错位置。
]]
_G =
'一个全局变量(非函数), 内部储存有全局环境(参见 §2.2)。 Lua 自己不使用这个变量; 改变这个变量的值不会对任何环境造成影响,反之亦然。'
getfenv =
'返回给定函数的环境。`f` 可以是一个Lua函数也可是一个表示调用栈层级的数字。'
getmetatable =
'如果 `object` 不包含元表,返回 `nil` 。 否则,如果在该对象的元表中有 `"__metatable"` 域时返回其关联值, 没有时返回该对象的元表。'
ipairs =
[[
返回三个值(迭代函数、表 `t` 以及 `0` 如此,以下代码
```lua
for i,v in ipairs(t) do body end
```
将迭代键值对 `1,t[1]) (2,t[2]) ...` ,直到第一个空值。
]]
loadmode.b =
'只能是二进制代码块。'
loadmode.t =
'只能是文本代码块。'
loadmode.bt =
'可以是二进制也可以是文本。'
load['<5.1'] =
'使用 `func` 分段加载代码块。 每次调用 `func` 必须返回一个字符串用于连接前文。'
load['>5.2'] =
[[
加载一个代码块。
如果 `chunk` 是一个字符串,代码块指这个字符串。 如果 `chunk` 是一个函数, `load` 不断地调用它获取代码块的片断。 每次对 `chunk` 的调用都必须返回一个字符串紧紧连接在上次调用的返回串之后。 当返回空串、`nil`、或是不返回值时,都表示代码块结束。
]]
loadfile =
'从文件 `filename` 或标准输入(如果文件名未提供)中获取代码块。'
loadstring =
'使用给定字符串加载代码块。'
module =
'创建一个模块。'
next =
[[
运行程序来遍历表中的所有域。 第一个参数是要遍历的表,第二个参数是表中的某个键。 `next` 返回该键的下一个键及其关联的值。 如果用 `nil` 作为第二个参数调用 `next` 将返回初始键及其关联值。 当以最后一个键去调用,或是以 `nil` 调用一张空表时, `next` 返回 `nil`。 如果不提供第二个参数,将认为它就是 `nil`。 特别指出,你可以用 `next(t)` 来判断一张表是否是空的。
索引在遍历过程中的次序无定义, 即使是数字索引也是这样。 (如果想按数字次序遍历表,可以使用数字形式的 `for` 。)
当在遍历过程中你给表中并不存在的域赋值, `next` 的行为是未定义的。 然而你可以去修改那些已存在的域。 特别指出,你可以清除一些已存在的域。
]]
pairs =
[[
如果 `t` 有元方法 `__pairs` 以 `t` 为参数调用它,并返回其返回的前三个值。
否则,返回三个值:`next` 函数, 表 `t`,以及 `nil`。 因此以下代码
```lua
for k,v in pairs(t) do body end
```
能迭代表 `t` 中的所有键值对。
参见函数 $next 中关于迭代过程中修改表的风险。
]]
pcall =
'传入参数,以 *保护模式* 调用函数 `f` 。 这意味着 `f` 中的任何错误不会抛出; 取而代之的是,`pcall` 会将错误捕获到,并返回一个状态码。 第一个返回值是状态码(一个布尔量), 当没有错误时,其为真。 此时,`pcall` 同样会在状态码后返回所有调用的结果。 在有错误时,`pcall` 返回 `false` 加错误消息。'
print =
'接收任意数量的参数,并将它们的值打印到 `stdout`。 它用 `tostring` 函数将每个参数都转换为字符串。 `print` 不用于做格式化输出。仅作为看一下某个值的快捷方式。 多用于调试。 完整的对输出的控制,请使用 $string.format 以及 $io.write。'
rawequal =
'在不触发任何元方法的情况下 检查 `v1` 是否和 `v2` 相等。 返回一个布尔量。'
rawget =
'在不触发任何元方法的情况下 获取 `table[index]` 的值。 `table` 必须是一张表; `index` 可以是任何值。'
rawlen =
'在不触发任何元方法的情况下 返回对象 `v` 的长度。 `v` 可以是表或字符串。 它返回一个整数。'
rawset =
[[
在不触发任何元方法的情况下 将 `table[index]` 设为 `value。` `table` 必须是一张表, `index` 可以是 `nil` 与 `NaN` 之外的任何值。 `value` 可以是任何 Lua 值。
这个函数返回 `table`。
]]
select =
'如果 `index` 是个数字, 那么返回参数中第 `index` 个之后的部分; 负的数字会从后向前索引(`-1` 指最后一个参数)。 否则,`index` 必须是字符串 `"#"` 此时 `select` 返回参数的个数。'
setfenv =
'设置给定函数的环境。'
setmetatable =
[[
给指定表设置元表。 (你不能在 Lua 中改变其它类型值的元表,那些只能在 C 里做。) 如果 `metatable` 是 `nil` 将指定表的元表移除。 如果原来那张元表有 `"__metatable"` 域,抛出一个错误。
]]
tonumber =
[[
如果调用的时候没有 `base` `tonumber` 尝试把参数转换为一个数字。 如果参数已经是一个数字,或是一个可以转换为数字的字符串, `tonumber` 就返回这个数字; 否则返回 `nil`。
字符串的转换结果可能是整数也可能是浮点数, 这取决于 Lua 的转换文法(参见 §3.1)。 (字符串可以有前置和后置的空格,可以带符号。)
]]
tostring =
[[
可以接收任何类型,它将其转换为人可阅读的字符串形式。 浮点数总被转换为浮点数的表现形式(小数点形式或是指数形式)。 (如果想完全控制数字如何被转换,可以使用 $string.format。
如果 `v` 有 `"__tostring"` 域的元表, `tostring` 会以 `v` 为参数调用它。 并用它的结果作为返回值。
]]
type =
[[
将参数的类型编码为一个字符串返回。 函数可能的返回值有 `"nil"` (一个字符串,而不是 `nil` 值), `"number"` `"string"` `"boolean"` `"table"` `"function"` `"thread"` `"userdata"`。
]]
_VERSION =
'一个包含有当前解释器版本号的全局变量(并非函数)。'
warn =
'使用所有参数组成的字符串消息来发送警告。'
xpcall['=5.1'] =
'传入参数,以 *保护模式* 调用函数 `f` 。这个函数和 `pcall` 类似。 不过它可以额外设置一个消息处理器 `err`。'
xpcall['>5.2'] =
'传入参数,以 *保护模式* 调用函数 `f` 。这个函数和 `pcall` 类似。 不过它可以额外设置一个消息处理器 `msgh`。'
unpack =
[[
返回给定 `list` 中的所有元素。 改函数等价于
```lua
return list[i], list[i+1], ···, list[j]
```
]]
bit32 =
''
bit32.arshift =
[[
返回 `x` 向右位移 `disp` 位的结果。`disp` 为负时向左位移。这是算数位移操作,左侧的空位使用 `x` 的高位填充,右侧空位使用 `0` 填充。
]]
bit32.band =
'返回参数按位与的结果。'
bit32.bnot =
[[
返回 `x` 按位取反的结果。
```lua
assert(bit32.bnot(x) ==
(-1 - x) % 2^32)
```
]]
bit32.bor =
'返回参数按位或的结果。'
bit32.btest =
'参数按位与的结果不为0时返回 `true` 。'
bit32.bxor =
'返回参数按位异或的结果。'
bit32.extract =
'返回 `n` 中第 `field` 到第 `field + width - 1` 位组成的结果。'
bit32.replace =
'返回 `v` 的第 `field` 到第 `field + width - 1` 位替换 `n` 的对应位后的结果。'
bit32.lrotate =
'返回 `x` 向左旋转 `disp` 位的结果。`disp` 为负时向右旋转。'
bit32.lshift =
[[
返回 `x` 向左位移 `disp` 位的结果。`disp` 为负时向右位移。空位总是使用 `0` 填充。
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
bit32.rrotate =
'返回 `x` 向右旋转 `disp` 位的结果。`disp` 为负时向左旋转。'
bit32.rshift =
[[
返回 `x` 向右位移 `disp` 位的结果。`disp` 为负时向左位移。空位总是使用 `0` 填充。
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
coroutine =
''
coroutine.create =
'创建一个主体函数为 `f` 的新协程。 f 必须是一个 Lua 的函数。 返回这个新协程,它是一个类型为 `"thread"` 的对象。'
coroutine.isyieldable =
'如果正在运行的协程可以让出,则返回真。'
coroutine.isyieldable['>5.4'] =
'如果协程 `co` 可以让出,则返回真。`co` 默认为正在运行的协程。'
coroutine.close =
'关闭协程 `co`,并关闭它所有等待 *to-be-closed* 的变量,并将协程状态设为 `dead` 。'
coroutine.resume =
'开始或继续协程 `co` 的运行。'
coroutine.running =
'返回当前正在运行的协程加一个布尔量。 如果当前运行的协程是主线程,其为真。'
coroutine.status =
'以字符串形式返回协程 `co` 的状态。'
coroutine.wrap =
'创建一个主体函数为 `f` 的新协程。 f 必须是一个 Lua 的函数。 返回一个函数, 每次调用该函数都会延续该协程。'
coroutine.yield =
'挂起正在调用的协程的执行。'
costatus.running =
'正在运行。'
costatus.suspended =
'挂起或是还没有开始运行。'
costatus.normal =
'是活动的,但并不在运行。'
costatus.dead =
'运行完主体函数或因错误停止。'
debug =
''
debug.debug =
'进入一个用户交互模式,运行用户输入的每个字符串。'
debug.getfenv =
'返回对象 `o` 的环境。'
debug.gethook =
'返回三个表示线程钩子设置的值: 当前钩子函数,当前钩子掩码,当前钩子计数 。'
debug.getinfo =
'返回关于一个函数信息的表。'
debug.getlocal['<5.1'] =
'返回在栈的 `level` 层处函数的索引为 `index` 的局部变量的名字和值。'
debug.getlocal['>5.2'] =
'返回在栈的 `f` 层处函数的索引为 `index` 的局部变量的名字和值。'
debug.getmetatable =
'返回给定 `value` 的元表。'
debug.getregistry =
'返回注册表。'
debug.getupvalue =
'返回函数 `f` 的第 `up` 个上值的名字和值。'
debug.getuservalue['<5.3']=
'返回关联在 `u` 上的 `Lua` 值。'
debug.getuservalue['>5.4']=
'返回关联在 `u` 上的第 `n` 个 `Lua` 值,以及一个布尔,`false`表示值不存在。'
debug.setcstacklimit =
[[
### **已在 `Lua 5.4.2` 中废弃**
设置新的C栈限制。该限制控制Lua中嵌套调用的深度以避免堆栈溢出。
如果设置成功,该函数返回之前的限制;否则返回`false`。
]]
debug.setfenv =
'将 `table` 设置为 `object` 的环境。'
debug.sethook =
'将一个函数作为钩子函数设入。'
debug.setlocal =
'将 `value` 赋给 栈上第 `level` 层函数的第 `local` 个局部变量。'
debug.setmetatable =
'将 `value` 的元表设为 `table` (可以是 `nil`)。'
debug.setupvalue =
'将 `value` 设为函数 `f` 的第 `up` 个上值。'
debug.setuservalue['<5.3']=
'将 `value` 设为 `udata` 的关联值。'
debug.setuservalue['>5.4']=
'将 `value` 设为 `udata` 的第 `n` 个关联值。'
debug.traceback =
'返回调用栈的栈回溯信息。 字符串可选项 `message` 被添加在栈回溯信息的开头。'
debug.upvalueid =
'返回指定函数第 `n` 个上值的唯一标识符(一个轻量用户数据)。'
debug.upvaluejoin =
'让 Lua 闭包 `f1` 的第 `n1` 个上值 引用 `Lua` 闭包 `f2` 的第 `n2` 个上值。'
infowhat.n =
'`name` 和 `namewhat`'
infowhat.S =
'`source``short_src``linedefined``lalinedefined`,和 `what`'
infowhat.l =
'`currentline`'
infowhat.t =
'`istailcall`'
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
'`nups`、`nparams` 和 `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
'`ftransfer` 和 `ntransfer`'
infowhat.L =
'`activelines`'
hookmask.c =
'每当 Lua 调用一个函数时,调用钩子。'
hookmask.r =
'每当 Lua 从一个函数内返回时,调用钩子。'
hookmask.l =
'每当 Lua 进入新的一行时,调用钩子。'
file =
''
file[':close'] =
'关闭 `file`。'
file[':flush'] =
'将写入的数据保存到 `file` 中。'
file[':lines'] =
[[
------
```lua
for c in file:lines(...) do
body
end
```
]]
file[':read'] =
'读文件 `file` 指定的格式决定了要读什么。'
file[':seek'] =
'设置及获取基于文件开头处计算出的位置。'
file[':setvbuf'] =
'设置输出文件的缓冲模式。'
file[':write'] =
'将参数的值逐个写入 `file`。'
readmode.n =
'读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
readmode.a =
'从当前位置开始读取整个文件。'
readmode.l =
'读取一行并忽略行结束标记。'
readmode.L =
'读取一行并保留行结束标记。'
seekwhence.set =
'基点为 0 (文件开头)。'
seekwhence.cur =
'基点为当前位置。'
seekwhence['.end'] =
'基点为文件尾。'
vbuf.no =
'不缓冲;输出操作立刻生效。'
vbuf.full =
'完全缓冲;只有在缓存满或调用 flush 时才做输出操作。'
vbuf.line =
'行缓冲;输出将缓冲到每次换行前。'
io =
''
io.stdin =
'标准输入。'
io.stdout =
'标准输出。'
io.stderr =
'标准错误。'
io.close =
'关闭 `file` 或默认输出文件。'
io.flush =
'将写入的数据保存到默认输出文件中。'
io.input =
'设置 `file` 为默认输入文件。'
io.lines =
[[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
io.open =
'用字符串 `mode` 指定的模式打开一个文件。'
io.output =
'设置 `file` 为默认输出文件。'
io.popen =
'用一个分离进程开启程序 `prog` 。'
io.read =
'读文件 `file` 指定的格式决定了要读什么。'
io.tmpfile =
'如果成功,返回一个临时文件的句柄。'
io.type =
'检查 `obj` 是否是合法的文件句柄。'
io.write =
'将参数的值逐个写入默认输出文件。'
openmode.r =
'读模式。'
openmode.w =
'写模式。'
openmode.a =
'追加模式。'
openmode['.r+'] =
'更新模式,所有之前的数据都保留。'
openmode['.w+'] =
'更新模式,所有之前的数据都删除。'
openmode['.a+'] =
'追加更新模式,所有之前的数据都保留,只允许在文件尾部做写入。'
openmode.rb =
'读模式。(二进制方式)'
openmode.wb =
'写模式。(二进制方式)'
openmode.ab =
'追加模式。(二进制方式)'
openmode['.r+b'] =
'更新模式,所有之前的数据都保留。(二进制方式)'
openmode['.w+b'] =
'更新模式,所有之前的数据都删除。(二进制方式)'
openmode['.a+b'] =
'追加更新模式,所有之前的数据都保留,只允许在文件尾部做写入。(二进制方式)'
popenmode.r =
'从这个程序中读取数据。(二进制方式)'
popenmode.w =
'向这个程序写入输入。(二进制方式)'
filetype.file =
'是一个打开的文件句柄。'
filetype['.closed file'] =
'是一个关闭的文件句柄。'
filetype['.nil'] =
'不是文件句柄。'
math =
''
math.abs =
'返回 `x` 的绝对值。'
math.acos =
'返回 `x` 的反余弦值(用弧度表示)。'
math.asin =
'返回 `x` 的反正弦值(用弧度表示)。'
math.atan['<5.2'] =
'返回 `x` 的反正切值(用弧度表示)。'
math.atan['>5.3'] =
'返回 `y/x` 的反正切值(用弧度表示)。'
math.atan2 =
'返回 `y/x` 的反正切值(用弧度表示)。'
math.ceil =
'返回不小于 `x` 的最小整数值。'
math.cos =
'返回 `x` 的余弦(假定参数是弧度)。'
math.cosh =
'返回 `x` 的双曲余弦(假定参数是弧度)。'
math.deg =
'将角 `x` 从弧度转换为角度。'
math.exp =
'返回 `e^x` 的值 e 为自然对数的底)。'
math.floor =
'返回不大于 `x` 的最大整数值。'
math.fmod =
'返回 `x` 除以 `y`,将商向零圆整后的余数。'
math.frexp =
'将 `x` 分解为尾数与指数,返回值符合 `x = m * (2 ^ e)` 。`e` 是一个整数,`m` 是 [0.5, 1) 之间的规格化小数 (`x` 为0时 `m` 为0)。'
math.huge =
'一个比任何数字值都大的浮点数。'
math.ldexp =
'返回 `m * (2 ^ e)` 。'
math.log['<5.1'] =
'返回 `x` 的自然对数。'
math.log['>5.2'] =
'回以指定底的 `x` 的对数。'
math.log10 =
'返回 `x` 的以10为底的对数。'
math.max =
'返回参数中最大的值, 大小由 Lua 操作 `<` 决定。'
math.maxinteger['>5.3'] =
'最大值的整数。'
math.min =
'返回参数中最小的值, 大小由 Lua 操作 `<` 决定。'
math.mininteger['>5.3'] =
'最小值的整数。'
math.modf =
'返回 `x` 的整数部分和小数部分。'
math.pi =
'*π* 的值。'
math.pow =
'返回 `x ^ y` 。'
math.rad =
'将角 `x` 从角度转换为弧度。'
math.random =
[[
* `math.random()`: 返回 [0,1) 区间内一致分布的浮点伪随机数。
* `math.random(n)`: 返回 [1, n] 区间内一致分布的整数伪随机数。
* `math.random(m, n)`: 返回 [m, n] 区间内一致分布的整数伪随机数。
]]
math.randomseed['<5.3'] =
'把 `x` 设为伪随机数发生器的“种子”: 相同的种子产生相同的随机数列。'
math.randomseed['>5.4'] =
[[
* `math.randomseed(x, y)`: 将 `x` 与 `y` 连接为128位的种子来重新初始化伪随机生成器。
* `math.randomseed(x)`: 等同于 `math.randomseed(x, 0)` 。
* `math.randomseed()`: Generates a seed with a weak attempt for randomness.(不会翻)
]]
math.sin =
'返回 `x` 的正弦值(假定参数是弧度)。'
math.sinh =
'返回 `x` 的双曲正弦值(假定参数是弧度)。'
math.sqrt =
'返回 `x` 的平方根。'
math.tan =
'返回 `x` 的正切值(假定参数是弧度)。'
math.tanh =
'返回 `x` 的双曲正切值(假定参数是弧度)。'
math.tointeger['>5.3'] =
'如果 `x` 可以转换为一个整数, 返回该整数。'
math.type['>5.3'] =
'如果 `x` 是整数,返回 `"integer"` 如果它是浮点数,返回 `"float"` 如果 `x` 不是数字,返回 `nil`。'
math.ult['>5.3'] =
'如果整数 `m` 和 `n` 以无符号整数形式比较, `m` 在 `n` 之下,返回布尔真否则返回假。'
os =
''
os.clock =
'返回程序使用的按秒计 CPU 时间的近似值。'
os.date =
'返回一个包含日期及时刻的字符串或表。 格式化方法取决于所给字符串 `format`。'
os.difftime =
'返回以秒计算的时刻 `t1` 到 `t2` 的差值。'
os.execute =
'调用系统解释器执行 `command`。'
os.exit['<5.1'] =
'调用 C 函数 `exit` 终止宿主程序。'
os.exit['>5.2'] =
'调用 ISO C 函数 `exit` 终止宿主程序。'
os.getenv =
'返回进程环境变量 `varname` 的值。'
os.remove =
'删除指定名字的文件。'
os.rename =
'将名字为 `oldname` 的文件或目录更名为 `newname`。'
os.setlocale =
'设置程序的当前区域。'
os.time =
'当不传参数时,返回当前时刻。 如果传入一张表,就返回由这张表表示的时刻。'
os.tmpname =
'返回一个可用于临时文件的文件名字符串。'
osdate.year =
'四位数字'
osdate.month =
'1-12'
osdate.day =
'1-31'
osdate.hour =
'0-23'
osdate.min =
'0-59'
osdate.sec =
'0-61'
osdate.wday =
'星期几1-7星期天为 1'
osdate.yday =
'当年的第几天1-366'
osdate.isdst =
'夏令时标记,一个布尔量'
package =
''
require['<5.3'] =
'加载一个模块,返回该模块的返回值(`nil`时为`true`)。'
require['>5.4'] =
'加载一个模块,返回该模块的返回值(`nil`时为`true`)与搜索器返回的加载数据。默认搜索器的加载数据指示了加载位置,对于文件来说就是文件路径。'
package.config =
'一个描述有一些为包管理准备的编译期配置信息的串。'
package.cpath =
'这个路径被 `require` 在 C 加载器中做搜索时用到。'
package.loaded =
'用于 `require` 控制哪些模块已经被加载的表。'
package.loaders =
'用于 `require` 控制如何加载模块的表。'
package.loadlib =
'让宿主程序动态链接 C 库 `libname` 。'
package.path =
'这个路径被 `require` 在 Lua 加载器中做搜索时用到。'
package.preload =
'保存有一些特殊模块的加载器。'
package.searchers =
'用于 `require` 控制如何加载模块的表。'
package.searchpath =
'在指定 `path` 中搜索指定的 `name` 。'
package.seeall =
'给 `module` 设置一个元表,该元表的 `__index` 域为全局环境,这样模块便会继承全局环境的值。可作为 `module` 函数的选项。'
string =
''
string.byte =
'返回字符 `s[i]` `s[i+1]` ... `s[j]` 的内部数字编码。'
string.char =
'接收零或更多的整数。 返回和参数数量相同长度的字符串。 其中每个字符的内部编码值等于对应的参数值。'
string.dump =
'返回包含有以二进制方式表示的(一个 *二进制代码块* )指定函数的字符串。'
string.find =
'查找第一个字符串中匹配到的 `pattern`(参见 §6.4.1)。'
string.format =
'返回不定数量参数的格式化版本,格式化串为第一个参数。'
string.gmatch =
[[
返回一个迭代器函数。 每次调用这个函数都会继续以 `pattern` 参见 §6.4.1 对 s 做匹配,并返回所有捕获到的值。
下面这个例子会循环迭代字符串 s 中所有的单词, 并逐行打印:
```lua
s =
"hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gsub =
'将字符串 s 中,所有的(或是在 n 给出时的前 n 个) pattern (参见 §6.4.1)都替换成 repl ,并返回其副本。'
string.len =
'返回其长度。'
string.lower =
'将其中的大写字符都转为小写后返回其副本。'
string.match =
'在字符串 s 中找到第一个能用 pattern (参见 §6.4.1)匹配到的部分。 如果能找到match 返回其中的捕获物; 否则返回 nil 。'
string.pack =
'返回一个打包了(即以二进制形式序列化) v1, v2 等值的二进制字符串。 字符串 fmt 为打包格式(参见 §6.4.2)。'
string.packsize =
[[返回以指定格式用 $string.pack 打包的字符串的长度。 格式化字符串中不可以有变长选项 's' 或 'z' (参见 §6.4.2)。]]
string.rep['>5.2'] =
'返回 `n` 个字符串 `s` 以字符串 `sep` 为分割符连在一起的字符串。 默认的 `sep` 值为空字符串(即没有分割符)。 如果 `n` 不是正数则返回空串。'
string.rep['<5.1'] =
'返回 `n` 个字符串 `s` 连在一起的字符串。 如果 `n` 不是正数则返回空串。'
string.reverse =
'返回字符串 s 的翻转串。'
string.sub =
'返回字符串的子串, 该子串从 `i` 开始到 `j` 为止。'
string.unpack =
'返回以格式 fmt (参见 §6.4.2 打包在字符串 s (参见 string.pack 中的值。'
string.upper =
'接收一个字符串,将其中的小写字符都转为大写后返回其副本。'
table =
''
table.concat =
'提供一个列表,其所有元素都是字符串或数字,返回字符串 `list[i]..sep..list[i+1] ··· sep..list[j]`。'
table.insert =
'在 `list` 的位置 `pos` 处插入元素 `value`。'
table.maxn =
'返回给定表的最大正数索引,如果表没有正数索引,则返回零。'
table.move =
[[
将元素从表 `a1` 移到表 `a2`。
```lua
a2[t],··· =
a1[f],···,a1[e]
return a2
```
]]
table.pack =
'返回用所有参数以键 `1`,`2`, 等填充的新表, 并将 `"n"` 这个域设为参数的总数。'
table.remove =
'移除 `list` 中 `pos` 位置上的元素,并返回这个被移除的值。'
table.sort =
'在表内从 `list[1]` 到 `list[#list]` *原地* 对其间元素按指定次序排序。'
table.unpack =
[[
返回列表中的元素。 这个函数等价于
```lua
return list[i], list[i+1], ···, list[j]
```
i 默认为 1 j 默认为 #list。
]]
table.foreach =
'遍历表中的每一个元素并以key和value执行回调函数。如果回调函数返回一个非nil值则循环终止,并且返回这个值。该函数等同pair(list),比pair(list)更慢。不推荐使用'
table.foreachi =
'遍历数组中的每一个元素并以索引号index和value执行回调函数。如果回调函数返回一个非nil值则循环终止,并且返回这个值。该函数等同ipair(list),比ipair(list)更慢。不推荐使用'
table.getn =
'返回表的长度。该函数等价于#list。'
table.new =
[[创建一个有初始容量的表,就像 C API 等价于 `lua_createtable()`。对于数据量庞大的表,如果最终的容量是已知的,这将十分有用,因为动态对表进行扩容是十分昂贵的。`narray` 参数指定类数组成员的数量,`nhash` 参数指定类哈希成员的数量。在使用前需要先引入。
```lua
require("table.new")
```
]]
table.clear =
[[清除表中所有的键值对,但是保留已经分配的数组或哈希的大小。当需要清除从多个位置链接的表和/或回收表供同一上下文使用时,这将十分有用。这避免了管理反向链接,节省了分配和增量数组或哈希部分增长的开销。在使用前需要先引入。
```lua
require("table.clear").
```
请注意此功能用于非常特殊的情况。在大多数情况下最好用新表替换通常是单个链接GC 完成回收工作。
]]
utf8 =
''
utf8.char =
'接收零或多个整数, 将每个整数转换成对应的 UTF-8 字节序列,并返回这些序列连接到一起的字符串。'
utf8.charpattern =
'用于精确匹配到一个 UTF-8 字节序列的模式,它假定处理的对象是一个合法的 UTF-8 字符串。'
utf8.codes =
[[
返回一系列的值,可以让
```lua
for p, c in utf8.codes(s) do
body
end
```
迭代出字符串 s 中所有的字符。 这里的 p 是位置(按字节数)而 c 是每个字符的编号。 如果处理到一个不合法的字节序列,将抛出一个错误。
]]
utf8.codepoint =
'以整数形式返回 `s` 中 从位置 `i` 到 `j` 间(包括两端) 所有字符的编号。'
utf8.len =
'返回字符串 `s` 中 从位置 `i` 到 `j` 间 (包括两端) UTF-8 字符的个数。'
utf8.offset =
'返回编码在 `s` 中的第 `n` 个字符的开始位置(按字节数) (从位置 `i` 处开始统计)。'

View File

@@ -0,0 +1,478 @@
---@diagnostic disable: undefined-global
config.addonManager.enable =
"是否启用扩展的附加插件管理器(Addon Manager)"
config.addonManager.repositoryBranch =
"指定插件管理器(Addon Manager)使用的git仓库分支"
config.addonManager.repositoryPath =
"指定插件管理器(Addon Manager)使用的git仓库路径"
config.addonRepositoryPath =
"指定插件仓库的路径(与 Addon Manager 无关)"
config.runtime.version =
"Lua运行版本。"
config.runtime.path =
[[
当使用 `require` 时,如何根据输入的名字来查找文件。
此选项设置为 `?/init.lua` 意味着当你输入 `require 'myfile'` 时,会从已加载的文件中搜索 `{workspace}/myfile/init.lua`。
当 `runtime.pathStrict` 设置为 `false` 时,还会尝试搜索 `${workspace}/**/myfile/init.lua`。
如果你想要加载工作区以外的文件,你需要先设置 `Lua.workspace.library`。
]]
config.runtime.pathStrict =
'启用后 `runtime.path` 将只搜索第一层目录,见 `runtime.path` 的说明。'
config.runtime.special =
[[将自定义全局变量视为一些特殊的内置变量,语言服务将提供特殊的支持。
下面这个例子表示将 `include` 视为 `require` 。
```json
"Lua.runtime.special" : {
"include" : "require"
}
```
]]
config.runtime.unicodeName =
"允许在名字中使用 Unicode 字符。"
config.runtime.nonstandardSymbol =
"支持非标准的符号。请务必确认你的运行环境支持这些符号。"
config.runtime.plugin =
"插件路径,请查阅[文档](https://luals.github.io/wiki/plugins)了解用法。"
config.runtime.pluginArgs =
"插件的额外参数。"
config.runtime.fileEncoding =
"文件编码,`ansi` 选项只在 `Windows` 平台下有效。"
config.runtime.builtin =
[[
调整内置库的启用状态,你可以根据实际运行环境禁用掉不存在的库(或重新定义)。
* `default`: 表示库会根据运行版本启用或禁用
* `enable`: 总是启用
* `disable`: 总是禁用
]]
config.runtime.meta =
'meta文件的目录名称格式。'
config.diagnostics.enable =
"启用诊断。"
config.diagnostics.disable =
"禁用的诊断(使用浮框括号内的代码)。"
config.diagnostics.globals =
"已定义的全局变量。"
config.diagnostics.globalsRegex =
"已定义的全局变量符合的正则表达式。"
config.diagnostics.severity =
[[
修改诊断等级。
以 `!` 结尾的设置优先级高于组设置 `diagnostics.groupSeverity`。
]]
config.diagnostics.neededFileStatus =
[[
* Opened: 只诊断打开的文件
* Any: 诊断任何文件
* None: 禁用此诊断
以 `!` 结尾的设置优先级高于组设置 `diagnostics.groupFileStatus`。
]]
config.diagnostics.groupSeverity =
[[
批量修改一个组中的诊断等级。
设置为 `Fallback` 意味着组中的诊断由 `diagnostics.severity` 单独设置。
其他设置将覆盖单独设置,但是不会覆盖以 `!` 结尾的设置。
]]
config.diagnostics.groupFileStatus =
[[
批量修改一个组中的文件状态。
* Opened: 只诊断打开的文件
* Any: 诊断任何文件
* None: 禁用此诊断
设置为 `Fallback` 意味着组中的诊断由 `diagnostics.neededFileStatus` 单独设置。
其他设置将覆盖单独设置,但是不会覆盖以 `!` 结尾的设置。
]]
config.diagnostics.workspaceEvent =
"设置触发工作区诊断的时机。"
config.diagnostics.workspaceEvent.OnChange =
"当文件发生变化时触发工作区诊断。"
config.diagnostics.workspaceEvent.OnSave =
"当文件保存时触发工作区诊断。"
config.diagnostics.workspaceEvent.None =
"关闭工作区诊断。"
config.diagnostics.workspaceDelay =
"进行工作区诊断的延迟(毫秒)。"
config.diagnostics.workspaceRate =
"工作区诊断的运行速率百分比。降低该值会减少CPU占用但是也会降低工作区诊断的速度。你当前正在编辑的文件的诊断总是全速完成不受该选项影响。"
config.diagnostics.libraryFiles =
"如何诊断通过 `Lua.workspace.library` 加载的文件。"
config.diagnostics.libraryFiles.Enable =
"总是诊断这些文件。"
config.diagnostics.libraryFiles.Opened =
"只有打开这些文件时才会诊断。"
config.diagnostics.libraryFiles.Disable =
"不诊断这些文件。"
config.diagnostics.ignoredFiles =
"如何诊断被忽略的文件。"
config.diagnostics.ignoredFiles.Enable =
"总是诊断这些文件。"
config.diagnostics.ignoredFiles.Opened =
"只有打开这些文件时才会诊断。"
config.diagnostics.ignoredFiles.Disable =
"不诊断这些文件。"
config.diagnostics.disableScheme =
'不诊断使用以下 scheme 的lua文件。'
config.diagnostics.unusedLocalExclude =
'如果变量名匹配以下规则,则不对其进行 `unused-local` 诊断。'
config.workspace.ignoreDir =
"忽略的文件与目录(使用 `.gitignore` 语法)。"
config.workspace.ignoreSubmodules =
"忽略子模块。"
config.workspace.useGitIgnore =
"忽略 `.gitignore` 中列举的文件。"
config.workspace.maxPreload =
"最大预加载文件数。"
config.workspace.preloadFileSize =
"预加载时跳过大小大于该值KB的文件。"
config.workspace.library =
"除了当前工作区以外,还会从哪些目录中加载文件。这些目录中的文件将被视作外部提供的代码库,部分操作(如重命名字段)不会修改这些文件。"
config.workspace.checkThirdParty =
[[
自动检测与适配第三方库,目前支持的库为:
* OpenResty
* Cocos4.0
* LÖVE
* LÖVR
* skynet
* Jass
]]
config.workspace.userThirdParty =
'在这里添加私有的第三方库适配文件路径,请参考内置的[配置文件路径](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd)'
config.workspace.supportScheme =
'为以下 scheme 的lua文件提供语言服务。'
config.completion.enable =
'启用自动完成。'
config.completion.callSnippet =
'显示函数调用片段。'
config.completion.callSnippet.Disable =
"只显示 `函数名`。"
config.completion.callSnippet.Both =
"显示 `函数名` 与 `调用片段`。"
config.completion.callSnippet.Replace =
"只显示 `调用片段`。"
config.completion.keywordSnippet =
'显示关键字语法片段'
config.completion.keywordSnippet.Disable =
"只显示 `关键字`。"
config.completion.keywordSnippet.Both =
"显示 `关键字` 与 `语法片段`。"
config.completion.keywordSnippet.Replace =
"只显示 `语法片段`。"
config.completion.displayContext =
"预览建议的相关代码片段,可能可以帮助你了解这项建议的用法。设置的数字表示代码片段的截取行数,设置为`0`可以禁用此功能。"
config.completion.workspaceWord =
"显示的上下文单词是否包含工作区中其他文件的内容。"
config.completion.showWord =
"在建议中显示上下文单词。"
config.completion.showWord.Enable =
"总是在建议中显示上下文单词。"
config.completion.showWord.Fallback =
"无法根据语义提供建议时才显示上下文单词。"
config.completion.showWord.Disable =
"不显示上下文单词。"
config.completion.autoRequire =
"输入内容看起来是个文件名时,自动 `require` 此文件。"
config.completion.showParams =
"在建议列表中显示函数的参数信息,函数拥有多个定义时会分开显示。"
config.completion.requireSeparator =
"`require` 时使用的分隔符。"
config.completion.postfix =
"用于触发后缀建议的符号。"
config.color.mode =
"着色模式。"
config.color.mode.Semantic =
"语义着色。你可能需要同时将 `editor.semanticHighlighting.enabled` 设置为 `true` 才能生效。"
config.color.mode.SemanticEnhanced =
"增强的语义颜色。 类似于`Semantic`,但会进行额外的分析(也会带来额外的开销)。"
config.color.mode.Grammar =
"语法着色。"
config.semantic.enable =
"启用语义着色。你可能需要同时将 `editor.semanticHighlighting.enabled` 设置为 `true` 才能生效。"
config.semantic.variable =
"对变量/字段/参数进行语义着色。"
config.semantic.annotation =
"对类型注解进行语义着色。"
config.semantic.keyword =
"对关键字/字面量/运算符进行语义着色。只有当你的编辑器无法进行语法着色时才需要启用此功能。"
config.signatureHelp.enable =
"启用参数提示。"
config.hover.enable =
"启用悬停提示。"
config.hover.viewString =
"悬停提示查看字符串内容(仅当字面量包含转义符时)。"
config.hover.viewStringMax =
"悬停提示查看字符串内容时的最大长度。"
config.hover.viewNumber =
"悬停提示查看数字内容(仅当字面量不是十进制时)。"
config.hover.fieldInfer =
"悬停提示查看表时,会对表的每个字段进行类型推测,当类型推测的用时累计达到该设定值(毫秒)时,将跳过后续字段的类型推测。"
config.hover.previewFields =
"悬停提示查看表时,限制表内字段的最大预览数量。"
config.hover.enumsLimit =
"当值对应多个类型时,限制类型的显示数量。"
config.hover.expandAlias =
[[
是否展开别名。例如 `---@alias myType boolean|number` 展开后显示为 `boolean|number`,否则显示为 `myType`。
]]
config.develop.enable =
'开发者模式。请勿开启,会影响性能。'
config.develop.debuggerPort =
'调试器监听端口。'
config.develop.debuggerWait =
'调试器连接之前挂起。'
config.intelliSense.searchDepth =
'设置智能感知的搜索深度。增大该值可以增加准确度,但会降低性能。不同的项目对该设置的容忍度差异较大,请自己调整为合适的值。'
config.intelliSense.fastGlobal =
'在对全局变量进行补全,及查看 `_G` 的悬浮提示时进行优化。这会略微降低类型推测的准确度,但是对于大量使用全局变量的项目会有大幅的性能提升。'
config.window.statusBar =
'在状态栏显示插件状态。'
config.window.progressBar =
'在状态栏显示进度条。'
config.hint.enable =
'启用内联提示。'
config.hint.paramType =
'在函数的参数位置提示类型。'
config.hint.setType =
'在赋值操作位置提示类型。'
config.hint.paramName =
'在函数调用处提示参数名。'
config.hint.paramName.All =
'所有类型的参数均进行提示。'
config.hint.paramName.Literal =
'只有字面量类型的参数进行提示。'
config.hint.paramName.Disable =
'禁用参数提示。'
config.hint.arrayIndex =
'在构造表时提示数组索引。'
config.hint.arrayIndex.Enable =
'所有的表中都提示数组索引。'
config.hint.arrayIndex.Auto =
'只有表大于3项或者表是混合类型时才进行提示。'
config.hint.arrayIndex.Disable =
'禁用数组索引提示。'
config.hint.await =
'如果调用的函数被标记为了 `---@async` ,则在调用处提示 `await` 。'
config.hint.awaitPropagate =
'启用 `await` 的传播, 当一个函数调用了一个`---@async`标记的函数时,会自动标记为`---@async`。'
config.hint.semicolon =
'若语句尾部没有分号,则显示虚拟分号。'
config.hint.semicolon.All =
'所有语句都显示虚拟分号。'
config.hint.semicolon.SameLine =
'2个语句在同一行时在它们之间显示分号。'
config.hint.semicolon.Disable =
'禁用虚拟分号。'
config.codeLens.enable =
'启用代码度量。'
config.format.enable =
'启用代码格式化程序。'
config.format.defaultConfig =
[[
默认的格式化配置,优先级低于工作区内的 `.editorconfig` 文件。
请查阅[格式化文档](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)了解用法。
]]
config.spell.dict =
'拼写检查的自定义单词。'
config.nameStyle.config =
[[
设定命名风格检查的配置。
请查阅[格式化文档](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)了解用法。
]]
config.telemetry.enable =
[[
启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://luals.github.io/privacy/#language-server)阅读我们的隐私声明。
]]
config.misc.parameters =
'VSCode中启动语言服务时的[命令行参数](https://luals.github.io/wiki/usage#arguments)。'
config.misc.executablePath =
'VSCode中指定可执行文件路径。'
config.language.fixIndent =
'(仅VSCode) 修复错误的自动缩进,例如在包含单词 "function" 的字符串中换行时出现的错误缩进。'
config.language.completeAnnotation =
'(仅VSCode) 在注解后换行时自动插入 "---@ "。'
config.type.castNumberToInteger =
'允许将 `number` 类型赋给 `integer` 类型。'
config.type.weakUnionCheck =
[[
联合类型中只要有一个子类型满足条件,则联合类型也满足条件。
此设置为 `false` 时,`number|boolean` 类型无法赋给 `number` 类型;为 `true` 时则可以。
]]
config.type.weakNilCheck =
[[
对联合类型进行类型检查时,忽略其中的 `nil`。
此设置为 `false` 时,`numer|nil` 类型无法赋给 `number` 类型;为 `true` 是则可以。
]]
config.type.inferParamType =
[[
未注释参数类型时,参数类型由函数传入参数推断。
如果设置为 "false",则在未注释时,参数类型为 "any"。
]]
config.type.checkTableShape =
[[
对表的形状进行严格检查。
]]
config.type.inferTableSize =
'类型推断期间分析的表字段的最大数量。'
config.doc.privateName =
'将特定名称的字段视为私有,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是私有字段,只能在定义所在的类中访问。'
config.doc.protectedName =
'将特定名称的字段视为受保护,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是受保护的字段,只能在定义所在的类极其子类中访问。'
config.doc.packageName =
'将特定名称的字段视为package例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 只能在定义所在的文件中访问。'
config.doc.regengine =
'用于匹配文档作用域名称的正则表达式引擎。'
config.doc.regengine.glob =
'默认轻量级模式语法。'
config.doc.regengine.lua =
'完整的 Lua 风格正则表达式。'
config.docScriptPath =
'自定义 Lua 脚本路径,覆盖默认文档生成行为。'
config.diagnostics['unused-local'] =
'未使用的局部变量'
config.diagnostics['unused-function'] =
'未使用的函数'
config.diagnostics['undefined-global'] =
'未定义的全局变量'
config.diagnostics['global-in-nil-env'] =
'不能使用全局变量( `_ENV` 被设置为了 `nil`'
config.diagnostics['unused-label'] =
'未使用的标签'
config.diagnostics['unused-vararg'] =
'未使用的不定参数'
config.diagnostics['trailing-space'] =
'后置空格'
config.diagnostics['redefined-local'] =
'重复定义的局部变量'
config.diagnostics['newline-call'] =
'以 `(` 开始的新行,在语法上被解析为了上一行的函数调用'
config.diagnostics['newfield-call'] =
'在字面量表中2行代码之间缺少分隔符在语法上被解析为了一次索引操作'
config.diagnostics['redundant-parameter'] =
'函数调用时,传入了多余的参数'
config.diagnostics['ambiguity-1'] =
'优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` '
config.diagnostics['lowercase-global'] =
'首字母小写的全局变量定义'
config.diagnostics['undefined-env-child'] =
'`_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中'
config.diagnostics['duplicate-index'] =
'在字面量表中重复定义了索引'
config.diagnostics['empty-block'] =
'空代码块'
config.diagnostics['redundant-value'] =
'赋值操作时,值的数量比被赋值的对象多'
config.diagnostics['assign-type-mismatch'] =
'值类型与赋值变量类型不匹配'
config.diagnostics['await-in-sync'] =
'同步函数中异步函数调用'
config.diagnostics['cast-local-type'] =
'已显式定义变量类型与要定义的值的类型不匹配'
config.diagnostics['cast-type-mismatch'] =
'变量被转换为与其初始类型不匹配的类型'
config.diagnostics['circular-doc-class'] =
'两个类相互继承并互相循环'
config.diagnostics['close-non-object'] =
'尝试关闭非对象变量的诊断'
config.diagnostics['code-after-break'] =
'放在循环中break语句后面的代码'
config.diagnostics['codestyle-check'] =
'启用对不正确样式行的诊断'
config.diagnostics['count-down-loop'] =
'for循环永远无法达到最大/极限值(在递减时递增)'
config.diagnostics['deprecated'] =
'变量已被标记为deprecated(过时)但仍在使用'
config.diagnostics['different-requires'] =
'required的同一个文件使用了两个不同的名字'
config.diagnostics['discard-returns'] =
'函数的返回值被忽略(函数被`@nodiscard`标记时)'
config.diagnostics['doc-field-no-class'] =
'为不存在的类`@class`标记`@field`字段'
config.diagnostics['duplicate-doc-alias'] =
'`@alias`字段的名字冲突'
config.diagnostics['duplicate-doc-field'] =
'`@field`字段的名字冲突'
config.diagnostics['duplicate-doc-param'] =
'`@param`字段的名字冲突'
config.diagnostics['duplicate-set-field'] =
'在一个类中多次定义同一字段'
config.diagnostics['incomplete-signature-doc'] =
'`@param`或`@return`的注释不完整'
config.diagnostics['invisible'] =
'使用不可见的值'
config.diagnostics['missing-global-doc'] =
'全局变量的注释缺失(全局函数必须为所有参数和返回值提供注释和注释)'
config.diagnostics['missing-local-export-doc'] =
'导出的本地函数缺少注释(导出的本地函数必须有包括本身以及所有参数和返回值的注释)'
config.diagnostics['missing-parameter'] =
'函数参数数少于注释函数参数数'
config.diagnostics['missing-return'] =
'函数带有返回注释而无返回语句'
config.diagnostics['missing-return-value'] =
'函数无值返回但函数使用`@return`标记了返回值'
config.diagnostics['need-check-nil'] =
'变量之前被赋值为`nil`或可选值(可能为 `nil`)'
config.diagnostics['unnecessary-assert'] =
'启用对冗余断言(针对始终为真值的表达式)的诊断'
config.diagnostics['no-unknown'] =
'变量的未知类型无法推断'
config.diagnostics['not-yieldable'] =
'不允许调用 `coroutine.yield()` '
config.diagnostics['param-type-mismatch'] =
'给定参数的类型与函数定义所要求的类型(`@param`)不匹配'
config.diagnostics['redundant-return'] =
'当放置一个不需要的返回值时触发(函数会自行退出)'
config.diagnostics['redundant-return-value']=
'返回`@return`注释未指定的额外值'
config.diagnostics['return-type-mismatch'] =
'返回值的类型与`@return`中声明的类型不匹配'
config.diagnostics['spell-check'] =
'启用字符串拼写检查的诊断。'
config.diagnostics['name-style-check'] =
'变量的名称样式检查'
config.diagnostics['unbalanced-assignments']=
'多重赋值时没有赋值所有变量(如`local x,y = 1`)'
config.diagnostics['undefined-doc-class'] =
'在`@class`注解中引用未定义的类。'
config.diagnostics['undefined-doc-name'] =
'在`@type`注解中引用未定义的类型或`@alias`'
config.diagnostics['undefined-doc-param'] =
'函数声明中`@param`引用了未定义的参数'
config.diagnostics['undefined-field'] =
'引用变量的未定义字段'
config.diagnostics['unknown-cast-variable'] =
'使用`@cast`对未定义变量的强制转换'
config.diagnostics['unknown-diag-code'] =
'未知的诊断代码'
config.diagnostics['unknown-operator'] =
'未知的运算符'
config.diagnostics['unreachable-code'] =
'不可达的代码'
config.diagnostics['global-element'] =
'启用诊断以警告全局元素。'
config.typeFormat.config =
'配置输入Lua代码时的格式化行为'
config.typeFormat.config.auto_complete_end =
'是否在合适的位置自动完成 `end`'
config.typeFormat.config.auto_complete_table_sep =
'是否在table末尾自动添加分隔符'
config.typeFormat.config.format_line =
'是否对某一行进行格式化'
command.exportDocument =
'Lua: 导出文档...'
command.addon_manager.open =
'Lua: 打开插件管理器...'
command.reloadFFIMeta =
'Lua: 重新生成luajit的FFI模块C语言元数据'
command.startServer =
'Lua: 重启语言服务器'
command.stopServer =
'Lua: 停止语言服务器'

View File

@@ -0,0 +1,747 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
'獨立版Lua的啟動引數。'
assert =
'如果其引數 `v` 的值為假( `nil` 或 `false` ),它就擲回 $error ;否則,回傳所有的引數。在發生錯誤時, `message` 是錯誤物件;如果不提供這個引數,預設為 `"assertion failed!"` 。'
cgopt.collect =
'做一次完整的垃圾回收循環。'
cgopt.stop =
'停止垃圾回收器的執行。'
cgopt.restart =
'重新啟動垃圾回收器的自動執行。'
cgopt.count =
'以 K 位元組數為單位回傳 Lua 使用的總記憶體數。'
cgopt.step =
'單步執行垃圾回收器。 步長“大小”由 `arg` 控制。'
cgopt.setpause =
'將 `arg` 設為回收器的 *間歇率* 。'
cgopt.setstepmul =
'將 `arg` 設為回收器的 *步進倍率* 。'
cgopt.incremental =
'改變回收器模式為增量模式。'
cgopt.generational =
'改變回收器模式為分代模式。'
cgopt.isrunning =
'回傳表示回收器是否在工作的布林值。'
collectgarbage =
'這個函式是垃圾回收器的一般介面。它透過引數 opt 提供了一組不同的功能。'
dofile =
'打開該名字的檔案,並執行檔案中的 Lua 程式碼區塊。不帶引數呼叫時, `dofile` 執行標準輸入的內容(`stdin`)。回傳該程式碼區塊的所有回傳值。對於有錯誤的情況, `dofile` 將錯誤回饋給呼叫者(即 `dofile` 沒有執行在保護模式下)。'
error =
[[
中止上一次保護函式呼叫,將錯誤物件 `message` 回傳。函式 `error` 永遠不會回傳。
當 `message` 是一個字串時,通常 `error` 會把一些有關出錯位置的資訊附加在訊息的開頭。 `level` 引數指明了怎樣獲得出錯位置。
]]
_G =
'一個全域變數(非函式),內部儲存有全域環境(參見 §2.2)。 Lua 自己不使用這個變數;改變這個變數的值不會對任何環境造成影響,反之亦然。'
getfenv =
'回傳給定函式的環境。 `f` 可以是一個Lua函式也可是一個表示呼叫堆疊層級的數字。'
getmetatable =
'如果 `object` 不包含中繼資料表,回傳 `nil` 。否則,如果在該物件的中繼資料表中有 `"__metatable"` 欄位時回傳其關聯值,沒有時回傳該對象的中繼資料表。'
ipairs =
[[
回傳三個值(疊代函式、表 `t` 以及 `0` ),如此,以下程式碼
```lua
for i,v in ipairs(t) do body end
```
將疊代鍵值對 `(1,t[1])、(2,t[2])...` ,直到第一個空值。
]]
loadmode.b =
'只能是二進制程式碼區塊。'
loadmode.t =
'只能是文字程式碼區塊。'
loadmode.bt =
'可以是二進制也可以是文字。'
load['<5.1'] =
'使用 `func` 分段載入程式碼區塊。每次呼叫 `func` 必須回傳一個字串用於連接前文。'
load['>5.2'] =
[[
載入一個程式碼區塊。
如果 `chunk` 是一個字串,程式碼區塊指這個字串。如果 `chunk` 是一個函式, `load` 不斷地呼叫它獲取程式碼區塊的片段。每次對 `chunk` 的呼叫都必須回傳一個字串緊緊連接在上次呼叫的回傳串之後。當回傳空串、 `nil` 、或是不回傳值時,都表示程式碼區塊結束。
]]
loadfile =
'從檔案 `filename` 或標準輸入(如果未提供檔名)中獲取程式碼區塊。'
loadstring =
'使用給定字串載入程式碼區塊。'
module =
'建立一個模組。'
next =
[[
執行程式來走訪表中的所有域。第一個引數是要走訪的表,第二個引數是表中的某個鍵。 `next` 回傳該鍵的下一個鍵及其關聯的值。如果用 `nil` 作為第二個引數呼叫 `next` 將回傳初始鍵及其關聯值。當以最後一個鍵去呼叫,或是以 `nil` 呼叫一張空表時, `next` 回傳 `nil`。如果不提供第二個引數,將預設它就是 `nil`。特別指出,你可以用 `next(t)` 來判斷一張表是否是空的。
索引在走訪過程中的順序無定義,即使是數字索引也是這樣。(如果想按數字順序走訪表,可以使用數字形式的 `for` 。)
當在走訪過程中你給表中並不存在的域賦值, `next` 的行為是未定義的。然而你可以去修改那些已存在的域。特別指出,你可以清除一些已存在的域。
]]
pairs =
[[
如果 `t` 有元方法 `__pairs` ,以 `t` 為引數呼叫它,並回傳其回傳的前三個值。
否則,回傳三個值: `next` 函式,表 `t` ,以及 `nil` 。因此以下程式碼
```lua
for k,v in pairs(t) do body end
```
能疊代表 `t` 中的所有鍵值對。
參見函式 $next 中關於疊代過程中修改表的風險。
]]
pcall =
'透過將函式 `f` 傳入引數,以 *保護模式* 呼叫 `f` 。這意味著 `f` 中的任何錯誤不會擲回;取而代之的是, `pcall` 會將錯誤捕獲到,並回傳一個狀態碼。第一個回傳值是狀態碼(一個布林值),當沒有錯誤時,其為 `true` 。此時, `pcall` 同樣會在狀態碼後回傳所有呼叫的結果。在有錯誤時,`pcall` 回傳 `false` 加錯誤訊息。'
print =
'接收任意數量的引數,並將它們的值列印到 `stdout`。它用 `tostring` 函式將每個引數都轉換為字串。 `print` 不用於做格式化輸出。僅作為看一下某個值的快捷方式,多用於除錯。完整的對輸出的控制,請使用 $string.format 以及 $io.write。'
rawequal =
'在不觸發任何元方法的情況下,檢查 `v1` 是否和 `v2` 相等。回傳一個布林值。'
rawget =
'在不觸發任何元方法的情況下,獲取 `table[index]` 的值。 `table` 必須是一張表; `index` 可以是任何值。'
rawlen =
'在不觸發任何元方法的情況下,回傳物件 `v` 的長度。 `v` 可以是表或字串。它回傳一個整數。'
rawset =
[[
在不觸發任何元方法的情況下,將 `table[index]` 設為 `value`。 `table` 必須是一張表, `index` 可以是 `nil` 與 `NaN` 之外的任何值。 `value` 可以是任何 Lua 值。
這個函式回傳 `table`。
]]
select =
'如果 `index` 是個數字,那麼回傳引數中第 `index` 個之後的部分;負的數字會從後向前索引(`-1` 指最後一個引數)。否則, `index` 必須是字串 `"#"` ,此時 `select` 回傳引數的個數。'
setfenv =
'設定給定函式的環境。'
setmetatable =
[[
為指定的表設定中繼資料表,如果 `metatable` 是 `nil`,則移除該表的中繼資料表。如果原來那張中繼資料表有 `"__metatable"` 欄位,則擲回一個錯誤。
這個函式回傳 `table`。
你必須使用除錯庫參見§6.10)才能修改 Lua 中其他類型的中繼資料表。
]]
tonumber =
[[
如果呼叫的時候沒有 `base` `tonumber` 會嘗試把引數轉換為一個數字。如果引數已經是一個數字,或是一個可以轉換為數字的字串, `tonumber` 就回傳這個數字,否則回傳 `fail`。
字串的轉換結果可能是整數也可能是浮點數,這取決於 Lua 的轉換文法(參見 §3.1)。(字串可以有前置和後置的空格,可以帶符號。)
]]
tostring =
[[
可以將任何類型轉換為人可閱讀的字串形式。浮點數總被轉換為浮點數的表現形式(小數點形式或是指數形式)。
如果 `v` 的中繼資料表有 `"__tostring"` 欄位, `tostring` 會以 `v` 為引數呼叫它。並用它的結果作為回傳值。
如果想完全控制數字如何被轉換,可以使用 $string.format 。
]]
type =
[[
將引數的類型編碼為一個字串回傳。 函式可能的回傳值有 `"nil"` (一個字串,而不是 `nil` 值)、 `"number"` 、 `"string"` 、 `"boolean"` 、 `"table"` 、 `"function"` 、 `"thread"` 和 `"userdata"`。
]]
_VERSION =
'一個包含有目前直譯器版本號的全域變數(並非函式)。'
warn =
'使用所有引數組成的字串訊息來發送警告。'
xpcall['=5.1'] =
'透過將函式 `f` 傳入引數,以 *保護模式* 呼叫 `f` 。這個函式和 `pcall` 類似。不過它可以額外設定一個訊息處理器 `err`。'
xpcall['>5.2'] =
'透過將函式 `f` 傳入引數,以 *保護模式* 呼叫 `f` 。這個函式和 `pcall` 類似。不過它可以額外設定一個訊息處理器 `msgh`。'
unpack =
[[
回傳給定 `list` 中的所有元素。該函式等價於
```lua
return list[i], list[i+1], ···, list[j]
```
]]
bit32 =
''
bit32.arshift =
[[
回傳 `x` 向右位移 `disp` 位的結果。`disp` 為負時向左位移。這是算數位元運算,左側的空位使用 `x` 的高位元填充,右側空位使用 `0` 填充。
]]
bit32.band =
'回傳參數按位元及的結果。'
bit32.bnot =
[[
回傳 `x` 按位元取反的結果。
```lua
assert(bit32.bnot(x) ==
(-1 - x) % 2^32)
```
]]
bit32.bor =
'回傳參數按位元或的結果。'
bit32.btest =
'參數按位元與的結果不為 `0` 時,回傳 `true` 。'
bit32.bxor =
'回傳參數按位元互斥或的結果。'
bit32.extract =
'回傳 `n` 中第 `field` 到第 `field + width - 1` 位組成的結果。'
bit32.replace =
'回傳 `v` 的第 `field` 到第 `field + width - 1` 位替換 `n` 的對應位後的結果。'
bit32.lrotate =
'回傳 `x` 向左旋轉 `disp` 位的結果。`disp` 為負時向右旋轉。'
bit32.lshift =
[[
回傳 `x` 向左位移 `disp` 位的結果。`disp` 為負時向右位移。空位總是使用 `0` 填充。
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
bit32.rrotate =
'回傳 `x` 向右旋轉 `disp` 位的結果。`disp` 為負時向左旋轉。'
bit32.rshift =
[[
回傳 `x` 向右位移 `disp` 位的結果。`disp` 為負時向左位移。空位總是使用 `0` 填充。
```lua
assert(bit32.lshift(b, disp) ==
(b * 2^disp) % 2^32)
```
]]
coroutine =
''
coroutine.create =
'建立一個主體函式為 `f` 的新共常式。 f 必須是一個 Lua 的函式。回傳這個新共常式,它是一個類型為 `"thread"` 的物件。'
coroutine.isyieldable =
'如果正在執行的共常式可以讓出,則回傳真。'
coroutine.isyieldable['>5.4'] =
'如果共常式 `co` 可以讓出,則回傳真。 `co` 預設為正在執行的共常式。'
coroutine.close =
'關閉共常式 `co` ,並關閉它所有等待 *to-be-closed* 的變數,並將共常式狀態設為 `dead` 。'
coroutine.resume =
'開始或繼續共常式 `co` 的執行。'
coroutine.running =
'回傳目前正在執行的共常式加一個布林值。如果目前執行的共常式是主執行緒,其為真。'
coroutine.status =
'以字串形式回傳共常式 `co` 的狀態。'
coroutine.wrap =
'建立一個主體函式為 `f` 的新共常式。 f 必須是一個 Lua 的函式。回傳一個函式,每次呼叫該函式都會延續該共常式。'
coroutine.yield =
'懸置正在呼叫的共常式的執行。'
costatus.running =
'正在執行。'
costatus.suspended =
'懸置或是還沒有開始執行。'
costatus.normal =
'是活動的,但並不在執行。'
costatus.dead =
'執行完主體函式或因錯誤停止。'
debug =
''
debug.debug =
'進入一個使用者互動模式,執行使用者輸入的每個字串。'
debug.getfenv =
'回傳物件 `o` 的環境。'
debug.gethook =
'回傳三個表示執行緒攔截設定的值:目前攔截函式,目前攔截遮罩,目前攔截計數。'
debug.getinfo =
'回傳關於一個函式資訊的表。'
debug.getlocal['<5.1'] =
'回傳在堆疊的 `level` 層處函式的索引為 `index` 的區域變數的名字和值。'
debug.getlocal['>5.2'] =
'回傳在堆疊的 `f` 層處函式的索引為 `index` 的區域變數的名字和值。'
debug.getmetatable =
'回傳給定 `value` 的中繼資料表。'
debug.getregistry =
'回傳註冊表。'
debug.getupvalue =
'回傳函式 `f` 的第 `up` 個上值的名字和值。'
debug.getuservalue['<5.3']=
'回傳關聯在 `u` 上的 `Lua` 值。'
debug.getuservalue['>5.4']=
'回傳關聯在 `u` 上的第 `n` 個 `Lua` 值,以及一個布林, `false` 表示值不存在。'
debug.setcstacklimit =
[[
### **已在 `Lua 5.4.2` 中棄用**
設定新的C堆疊限制。該限制控制Lua中巢狀呼叫的深度以避免堆疊溢出。
如果設定成功,該函式回傳之前的限制;否則回傳 `false`。
]]
debug.setfenv =
'將 `table` 設定為 `object` 的環境。'
debug.sethook =
'將一個函式設定為攔截函式。'
debug.setlocal =
'將 `value` 賦給 堆疊上第 `level` 層函式的第 `local` 個區域變數。'
debug.setmetatable =
'將 `value` 的中繼資料表設為 `table` (可以是 `nil` )。'
debug.setupvalue =
'將 `value` 設為函式 `f` 的第 `up` 個上值。'
debug.setuservalue['<5.3']=
'將 `value` 設為 `udata` 的關聯值。'
debug.setuservalue['>5.4']=
'將 `value` 設為 `udata` 的第 `n` 個關聯值。'
debug.traceback =
'回傳呼叫堆疊的堆疊回溯資訊。字串可選項 `message` 被添加在堆疊回溯資訊的開頭。'
debug.upvalueid =
'回傳指定函式第 `n` 個上值的唯一識別字(一個輕量使用者資料)。'
debug.upvaluejoin =
'讓 Lua 閉包 `f1` 的第 `n1` 個上值 引用 `Lua` 閉包 `f2` 的第 `n2` 個上值。'
infowhat.n =
'`name` 和 `namewhat`'
infowhat.S =
'`source` 、 `short_src` 、 `linedefined` 、 `lalinedefined` 和 `what`'
infowhat.l =
'`currentline`'
infowhat.t =
'`istailcall`'
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
'`nups` 、 `nparams` 和 `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
'`ftransfer` 和 `ntransfer`'
infowhat.L =
'`activelines`'
hookmask.c =
'每當 Lua 呼叫一個函式時,呼叫攔截。'
hookmask.r =
'每當 Lua 從一個函式內回傳時,呼叫攔截。'
hookmask.l =
'每當 Lua 進入新的一行時,呼叫攔截。'
file =
''
file[':close'] =
'關閉 `file`。'
file[':flush'] =
'將寫入的資料儲存到 `file` 中。'
file[':lines'] =
[[
------
```lua
for c in file:lines(...) do
body
end
```
]]
file[':read'] =
'讀取檔案 `file` ,指定的格式決定了要讀取什麼。'
file[':seek'] =
'設定及獲取基於檔案開頭處計算出的位置。'
file[':setvbuf'] =
'設定輸出檔案的緩衝模式。'
file[':write'] =
'將引數的值逐個寫入 `file` 。'
readmode.n =
'讀取一個數字,根據 Lua 的轉換文法回傳浮點數或整數。'
readmode.a =
'從目前位置開始讀取整個檔案。'
readmode.l =
'讀取一行並忽略行尾標記。'
readmode.L =
'讀取一行並保留行尾標記。'
seekwhence.set =
'基點為 0 (檔案開頭)。'
seekwhence.cur =
'基點為目前位置。'
seekwhence['.end'] =
'基點為檔案尾。'
vbuf.no =
'不緩衝;輸出操作即時生效。'
vbuf.full =
'完全緩衝;只有在快取滿或呼叫 flush 時才做輸出操作。'
vbuf.line =
'行緩衝;輸出將緩衝到每次換行前。'
io =
''
io.stdin =
'標準輸入。'
io.stdout =
'標準輸出。'
io.stderr =
'標準錯誤。'
io.close =
'關閉 `file` 或預設輸出檔案。'
io.flush =
'將寫入的資料儲存到預設輸出檔案中。'
io.input =
'設定 `file` 為預設輸入檔案。'
io.lines =
[[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
io.open =
'用字串 `mode` 指定的模式打開一個檔案。'
io.output =
'設定 `file` 為預設輸出檔案。'
io.popen =
'用一個分離處理程序開啟程式 `prog` 。'
io.read =
'讀取檔案 `file` ,指定的格式決定了要讀取什麼。'
io.tmpfile =
'如果成功,回傳一個臨時檔案的控制代碼。'
io.type =
'檢查 `obj` 是否是合法的檔案控制代碼。'
io.write =
'將引數的值逐個寫入預設輸出檔案。'
openmode.r =
'讀取模式。'
openmode.w =
'寫入模式。'
openmode.a =
'追加模式。'
openmode['.r+'] =
'更新模式,所有之前的資料都保留。'
openmode['.w+'] =
'更新模式,所有之前的資料都刪除。'
openmode['.a+'] =
'追加更新模式,所有之前的資料都保留,只允許在檔案尾部做寫入。'
openmode.rb =
'讀取模式。(二進制方式)'
openmode.wb =
'寫入模式。(二進制方式)'
openmode.ab =
'追加模式。(二進制方式)'
openmode['.r+b'] =
'更新模式,所有之前的資料都保留。(二進制方式)'
openmode['.w+b'] =
'更新模式,所有之前的資料都刪除。(二進制方式)'
openmode['.a+b'] =
'追加更新模式,所有之前的資料都保留,只允許在檔案尾部做寫入。(二進制方式)'
popenmode.r =
'從這個程式讀取資料。(二進制方式)'
popenmode.w =
'向這個程式寫入資料。(二進制方式)'
filetype.file =
'是一個打開的檔案控制代碼。'
filetype['.closed file'] =
'是一個關閉的檔案控制代碼。'
filetype['.nil'] =
'不是檔案控制代碼。'
math =
''
math.abs =
'回傳 `x` 的絕對值。'
math.acos =
'回傳 `x` 的反餘弦值(用弧度表示)。'
math.asin =
'回傳 `x` 的反正弦值(用弧度表示)。'
math.atan['<5.2'] =
'回傳 `x` 的反正切值(用弧度表示)。'
math.atan['>5.3'] =
'回傳 `y/x` 的反正切值(用弧度表示)。'
math.atan2 =
'回傳 `y/x` 的反正切值(用弧度表示)。'
math.ceil =
'回傳不小於 `x` 的最小整數值。'
math.cos =
'回傳 `x` 的餘弦(假定引數是弧度)。'
math.cosh =
'回傳 `x` 的雙曲餘弦(假定引數是弧度)。'
math.deg =
'將角 `x` 從弧度轉換為角度。'
math.exp =
'回傳 `e^x` 的值e 為自然對數的底)。'
math.floor =
'回傳不大於 `x` 的最大整數值。'
math.fmod =
'回傳 `x` 除以 `y`,將商向零捨入後的餘數。'
math.frexp =
'將 `x` 分解為尾數與指數,回傳值符合 `x = m * (2 ^ e)` 。`e` 是一個整數,`m` 是 [0.5, 1) 之間的規格化小數 (`x` 為0時 `m` 為0)。'
math.huge =
'一個比任何數字值都大的浮點數。'
math.ldexp =
'回傳 `m * (2 ^ e)` 。'
math.log['<5.1'] =
'回傳 `x` 的自然對數。'
math.log['>5.2'] =
'回傳指定底的 `x` 的對數。'
math.log10 =
'回傳 `x` 的以10為底的對數。'
math.max =
'回傳引數中最大的值,大小由 Lua 運算子 `<` 決定。'
math.maxinteger['>5.3'] =
'最大值的整數。'
math.min =
'回傳引數中最小的值,大小由 Lua 運算子 `<` 決定。'
math.mininteger['>5.3'] =
'最小值的整數。'
math.modf =
'回傳 `x` 的整數部分和小數部分。'
math.pi =
'*π* 的值。'
math.pow =
'回傳 `x ^ y` 。'
math.rad =
'將角 `x` 從角度轉換為弧度。'
math.random =
[[
* `math.random()` :回傳 [0,1) 區間內均勻分佈的浮點偽隨機數。
* `math.random(n)` :回傳 [1, n] 區間內均勻分佈的整數偽隨機數。
* `math.random(m, n)` :回傳 [m, n] 區間內均勻分佈的整數偽隨機數。
]]
math.randomseed['<5.3'] =
'把 `x` 設為偽隨機數發生器的“種子”: 相同的種子產生相同的隨機數列。'
math.randomseed['>5.4'] =
[[
* `math.randomseed(x, y)` :將 `x` 與 `y` 連接為128位的種子來重新初始化偽隨機產生器。
* `math.randomseed(x)` :等同於 `math.randomseed(x, 0)` 。
* `math.randomseed()` :產生一個較弱的隨機種子。
]]
math.sin =
'回傳 `x` 的正弦值(假定引數是弧度)。'
math.sinh =
'回傳 `x` 的雙曲正弦值(假定引數是弧度)。'
math.sqrt =
'回傳 `x` 的平方根。'
math.tan =
'回傳 `x` 的正切值(假定引數是弧度)。'
math.tanh =
'回傳 `x` 的雙曲正切值(假定引數是弧度)。'
math.tointeger['>5.3'] =
'如果 `x` 可以轉換為一個整數,回傳該整數。'
math.type['>5.3'] =
'如果 `x` 是整數,回傳 `"integer"` ,如果它是浮點數,回傳 `"float"` ,如果 `x` 不是數字,回傳 `nil` 。'
math.ult['>5.3'] =
'整數 `m` 和 `n` 以無符號整數形式比較,如果 `m` 小於 `n` 則回傳布林真,否則回傳假。'
os =
''
os.clock =
'回傳程式使用的 CPU 時間的近似值,單位為秒。'
os.date =
'回傳一個包含日期及時刻的字串或表。格式化方法取決於所給字串 `format` 。'
os.difftime =
'回傳以秒計算的時刻 `t1` 到 `t2` 的差值。'
os.execute =
'呼叫作業系統殼層執行 `command` 。'
os.exit['<5.1'] =
'呼叫 C 函式 `exit` 終止宿主程式。'
os.exit['>5.2'] =
'呼叫 ISO C 函式 `exit` 終止宿主程式。'
os.getenv =
'回傳處理程序環境變數 `varname` 的值。'
os.remove =
'刪除指定名字的檔案。'
os.rename =
'將名字為 `oldname` 的檔案或資料夾重新命名為 `newname`。'
os.setlocale =
'設定程式的目前區域。'
os.time =
'當不傳引數時,回傳目前時刻。如果傳入一張表,就回傳由這張表表示的時刻。'
os.tmpname =
'回傳一個可用於臨時檔案的檔名字串。'
osdate.year =
'四位數字'
osdate.month =
'1-12'
osdate.day =
'1-31'
osdate.hour =
'0-23'
osdate.min =
'0-59'
osdate.sec =
'0-61'
osdate.wday =
'星期幾範圍為1-7星期天為 1'
osdate.yday =
'該年的第幾天範圍為1-366'
osdate.isdst =
'是否為夏令時間,一個布林值'
package =
''
require['<5.3'] =
'載入一個模組,回傳該模組的回傳值( `nil` 時為 `true` )。'
require['>5.4'] =
'載入一個模組,回傳該模組的回傳值( `nil` 時為 `true` )與搜尋器回傳的載入資料。預設搜尋器的載入資料指示了載入位置,對於檔案來說就是檔案路徑。'
package.config =
'一個描述一些為包管理準備的編譯時期組態的字串。'
package.cpath =
'這個路徑被 `require` 在 C 載入器中做搜尋時用到。'
package.loaded =
'用於 `require` 控制哪些模組已經被載入的表。'
package.loaders =
'用於 `require` 控制如何載入模組的表。'
package.loadlib =
'讓宿主程式動態連結 C 庫 `libname` 。'
package.path =
'這個路徑被 `require` 在 Lua 載入器中做搜尋時用到。'
package.preload =
'儲存有一些特殊模組的載入器。'
package.searchers =
'用於 `require` 控制如何載入模組的表。'
package.searchpath =
'在指定 `path` 中搜尋指定的 `name` 。'
package.seeall =
'給 `module` 設定一個中繼資料表,該中繼資料表的 `__index` 域為全域環境,這樣模組便會繼承全域環境的值。可作為 `module` 函式的選項。'
string =
''
string.byte =
'回傳字元 `s[i]` 、 `s[i+1]` ... `s[j]` 的內部數字編碼。'
string.char =
'回傳和引數數量相同長度的字串。其中每個字元的內部編碼值等於對應的引數值。'
string.dump =
'回傳包含有以二進制方式表示的(一個 *二進制程式碼區塊* )指定函式的字串。'
string.find =
'尋找第一個字串中配對到的 `pattern`(參見 §6.4.1)。'
string.format =
'回傳不定數量引數的格式化版本,格式化字串為第一個引數。'
string.gmatch =
[[
回傳一個疊代器函式。每次呼叫這個函式都會繼續以 `pattern` (參見 §6.4.1)對 s 做配對,並回傳所有捕獲到的值。
下面這個例子會循環疊代字串 s 中所有的單詞, 並逐行列印:
```lua
s =
"hello world from Lua"
for w in string.gmatch(s, "%a+") do
print(w)
end
```
]]
string.gsub =
'將字串 s 中,所有的(或是有提供 n 時的前 n 個) `pattern` (參見 §6.4.1)都替換成 `repl` ,並回傳其副本。'
string.len =
'回傳其長度。'
string.lower =
'將其中的大寫字元都轉為小寫後回傳其副本。'
string.match =
'在字串 s 中找到第一個能用 `pattern` (參見 §6.4.1)配對到的部分。如果能找到,回傳其中的捕獲物,否則回傳 `nil` 。'
string.pack =
'回傳一個壓縮了(即以二進制形式序列化) v1, v2 等值的二進制字串。字串 `fmt` 為壓縮格式(參見 §6.4.2)。'
string.packsize =
[[回傳以指定格式用 $string.pack 壓縮的字串的長度。格式化字串中不可以有變長選項 's' 或 'z' (參見 §6.4.2)。]]
string.rep['>5.2'] =
'回傳 `n` 個由字串 `s` 以字串 `sep` 為分割符連在一起的字串。預設的 `sep` 值為空字串(即沒有分割符)。如果 `n` 不是正數則回傳空字串。'
string.rep['<5.1'] =
'回傳 `n` 個由字串 `s` 連在一起的字串。如果 `n` 不是正數則回傳空字串。'
string.reverse =
'回傳字串 `s` 的反轉字串。'
string.sub =
'回傳一個從 `i` 開始並在 `j` 結束的子字串。'
string.unpack =
'回傳以格式 `fmt` (參見 §6.4.2 壓縮在字串 `s` (參見 $string.pack 中的值。'
string.upper =
'接收一個字串,將其中的小寫字元都轉為大寫後回傳其副本。'
table =
''
table.concat =
'提供一個列表,其所有元素都是字串或數字,回傳字串 `list[i]..sep..list[i+1] ··· sep..list[j]`。'
table.insert =
'在 `list` 的位置 `pos` 處插入元素 `value`。'
table.maxn =
'回傳給定表的最大正數索引,如果表沒有正數索引,則回傳零。'
table.move =
[[
將元素從表 `a1` 移到表 `a2`。
```lua
a2[t],··· =
a1[f],···,a1[e]
return a2
```
]]
table.pack =
'回傳用所有引數以鍵 `1`,`2`, 等填充的新表,並將 `"n"` 這個域設為引數的總數。'
table.remove =
'移除 `list` 中 `pos` 位置上的元素,並回傳這個被移除的值。'
table.sort =
'在表內從 `list[1]` 到 `list[#list]` *原地* 對其間元素按指定順序排序。'
table.unpack =
[[
回傳列表中的元素。這個函式等價於
```lua
return list[i], list[i+1], ···, list[j]
```
i 預設為 1 j 預設為 #list。
]]
table.foreach =
'走訪表中的每一個元素並以key和value執行回呼函式。如果回呼函式回傳一個非nil值則終止迴圈並且回傳這個值。該函式等同pair(list)比pair(list)更慢,不推薦使用。'
table.foreachi =
'走訪表中的每一個元素並以索引號index和value執行回呼函式。如果回呼函式回傳一個非nil值則終止迴圈並且回傳這個值。該函式等同ipair(list)比ipair(list)更慢,不推薦使用。'
table.getn =
'回傳表的長度。該函式等價於#list。'
table.new =
[[這將建立一個預先確定大小的表,就像和 C API 等價的 `lua_createtable()` 一樣。如果已確定最終表的大小,而且自動更改大小很耗效能的話,這對大表很有用。 `narray` 參數指定像陣列般元素的數量,而 `nhash` 參數指定像雜湊般元素的數量。使用這個函式前需要先 require。
```lua
require("table.new")
```
]]
table.clear =
[[這會清除表中的所有的鍵值對,但保留分配的陣列或雜湊大小。當需要清除從多個位置連結的表,或回收表以供同一上下文使用時很有用。這避免了管理反向連結,節省了分配和增加陣列/雜湊部分而增長的開銷。使用這個函式前需要先 require。
```lua
require("table.clear")
```
請注意,此函式適用於非常特殊的情況。在大多數情況下,最好用新表替換(通常是單個)連結,並讓垃圾回收自行處理。
]]
utf8 =
''
utf8.char =
'接收零或多個整數,將每個整數轉換成對應的 UTF-8 位元組序列,並回傳這些序列連接到一起的字串。'
utf8.charpattern =
'用於精確配對到一個 UTF-8 位元組序列的模式,它假定處理的對象是一個合法的 UTF-8 字串。'
utf8.codes =
[[
回傳一系列的值,可以讓
```lua
for p, c in utf8.codes(s) do
body
end
```
疊代出字串 `s` 中所有的字元。這裡的 `p` 是位置(按位元組數)而 `c` 是每個字元的編號。如果處理到一個不合法的位元組序列,將擲回一個錯誤。
]]
utf8.codepoint =
'以整數形式回傳 `s` 中 從位置 `i` 到 `j` 間(包括兩端)所有字元的編號。'
utf8.len =
'回傳字串 `s` 中 從位置 `i` 到 `j` 間 (包括兩端) UTF-8 字元的個數。'
utf8.offset =
'回傳編碼在 `s` 中的第 `n` 個字元的開始位置(按位元組數)(從位置 `i` 處開始統計)。'

View File

@@ -0,0 +1,478 @@
---@diagnostic disable: undefined-global
config.addonManager.enable =
"是否啟用延伸模組的附加插件管理器Addon Manager"
config.addonManager.repositoryBranch =
"指定插件管理器Addon Manager使用的git branch。"
config.addonManager.repositoryPath =
"指定插件管理器Addon Manager使用的git path。"
config.addonRepositoryPath = -- TODO: need translate!
"Specifies the addon repository path (not related to the addon manager)."
config.runtime.version =
"Lua執行版本。"
config.runtime.path =
[[
當使用 `require` 時,如何根據輸入的名字來尋找檔案。
此選項設定為 `?/init.lua` 時,代表當你輸入 `require 'myfile'` 時,會從已載入的檔案中搜尋 `{workspace}/myfile/init.lua`。
當 `runtime.pathStrict` 設定為 `false` 時,還會嘗試搜尋 `${workspace}/**/myfile/init.lua`。
如果你想要載入工作區以外的檔案,你需要先設定 `Lua.workspace.library`。
]]
config.runtime.pathStrict =
'啟用後 `runtime.path` 將只搜尋第一層目錄,見 `runtime.path` 的說明。'
config.runtime.special =
[[將自訂全域變數視為一些特殊的內建變數,語言伺服將提供特殊的支援。
下面這個例子表示將 `include` 視為 `require` 。
```json
"Lua.runtime.special" : {
"include" : "require"
}
```
]]
config.runtime.unicodeName =
"允許在名字中使用 Unicode 字元。"
config.runtime.nonstandardSymbol =
"支援非標準的符號。請務必確認你的執行環境支援這些符號。"
config.runtime.plugin =
"延伸模組路徑,請查閱[文件](https://luals.github.io/wiki/plugins)瞭解用法。"
config.runtime.pluginArgs =
"延伸模組的額外引數。"
config.runtime.fileEncoding =
"檔案編碼,選項 `ansi` 只在 `Windows` 平台下有效。"
config.runtime.builtin =
[[
調整內建庫的啟用狀態,你可以根據實際執行環境停用(或重新定義)不存在的庫。
* `default`: 表示庫會根據執行版本啟用或停用
* `enable`: 總是啟用
* `disable`: 總是停用
]]
config.runtime.meta =
'meta檔案的目錄名稱格式'
config.diagnostics.enable =
"啟用診斷。"
config.diagnostics.disable =
"停用的診斷(使用浮框括號內的程式碼)。"
config.diagnostics.globals =
"已定義的全域變數。"
config.diagnostics.globalsRegex =
"使用正規表示式尋找全域變數。"
config.diagnostics.severity =
[[
修改診斷等級。
以 `!` 結尾的設定優先順序高於組設定 `diagnostics.groupSeverity`。
]]
config.diagnostics.neededFileStatus =
[[
* Opened: 只診斷打開的檔案
* Any: 診斷所有檔案
* None: 停用此診斷
以 `!` 結尾的設定優先順序高於組設定 `diagnostics.groupFileStatus`。
]]
config.diagnostics.groupSeverity =
[[
批次修改一個組中的診斷等級。
設定為 `Fallback` 意味著組中的診斷由 `diagnostics.severity` 單獨設定。
其他設定將覆蓋單獨設定,但是不會覆蓋以 `!` 結尾的設定。
]]
config.diagnostics.groupFileStatus =
[[
批次修改一個組中的檔案狀態。
* Opened: 只診斷打開的檔案
* Any: 診斷所有檔案
* None: 停用此診斷
設定為 `Fallback` 意味著組中的診斷由 `diagnostics.neededFileStatus` 單獨設定。
其他設定將覆蓋單獨設定,但是不會覆蓋以 `!` 結尾的設定。
]]
config.diagnostics.workspaceEvent =
"設定觸發工作區診斷的時機。"
config.diagnostics.workspaceEvent.OnChange =
"當檔案發生變化時觸發工作區診斷。"
config.diagnostics.workspaceEvent.OnSave =
"當儲存檔案時觸發工作區診斷。"
config.diagnostics.workspaceEvent.None =
"停用工作區診斷。"
config.diagnostics.workspaceDelay =
"進行工作區診斷的延遲(毫秒)。"
config.diagnostics.workspaceRate =
"工作區診斷的執行速率百分比。降低該值會減少CPU使用率但是也會降低工作區診斷的速度。你目前正在編輯的檔案的診斷總是全速完成不受該選項影響。"
config.diagnostics.libraryFiles =
"如何診斷透過 `Lua.workspace.library` 載入的檔案。"
config.diagnostics.libraryFiles.Enable =
"總是診斷這些檔案。"
config.diagnostics.libraryFiles.Opened =
"只有打開這些檔案時才會診斷。"
config.diagnostics.libraryFiles.Disable =
"不診斷這些檔案。"
config.diagnostics.ignoredFiles =
"如何診斷被忽略的檔案。"
config.diagnostics.ignoredFiles.Enable =
"總是診斷這些檔案。"
config.diagnostics.ignoredFiles.Opened =
"只有打開這些檔案時才會診斷。"
config.diagnostics.ignoredFiles.Disable =
"不診斷這些檔案。"
config.diagnostics.disableScheme =
'不診斷使用以下 scheme 的lua檔案。'
config.diagnostics.unusedLocalExclude =
'如果變數名符合以下規則,則不對其進行 `unused-local` 診斷。'
config.workspace.ignoreDir =
"忽略的檔案與目錄(使用 `.gitignore` 語法)。"
config.workspace.ignoreSubmodules =
"忽略子模組。"
config.workspace.useGitIgnore =
"忽略 `.gitignore` 中列舉的檔案。"
config.workspace.maxPreload =
"最大預先載入檔案數。"
config.workspace.preloadFileSize =
"預先載入時跳過大小大於該值KB的檔案。"
config.workspace.library =
"除了目前工作區以外,還會從哪些目錄中載入檔案。這些目錄中的檔案將被視作外部提供的程式碼庫,部分操作(如重新命名欄位)不會修改這些檔案。"
config.workspace.checkThirdParty =
[[
自動偵測與適應第三方庫,目前支援的庫為:
* OpenResty
* Cocos4.0
* LÖVE
* LÖVR
* skynet
* Jass
]]
config.workspace.userThirdParty =
'在這裡添加私有的第三方庫適應檔案路徑,請參考內建的[組態檔案路徑](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd)'
config.workspace.supportScheme =
'為以下 `scheme` 的lua檔案提供語言伺服。'
config.completion.enable =
'啟用自動完成。'
config.completion.callSnippet =
'顯示函式呼叫片段。'
config.completion.callSnippet.Disable =
"只顯示 `函式名`。"
config.completion.callSnippet.Both =
"顯示 `函式名` 與 `呼叫片段`。"
config.completion.callSnippet.Replace =
"只顯示 `呼叫片段`。"
config.completion.keywordSnippet =
'顯示關鍵字語法片段。'
config.completion.keywordSnippet.Disable =
"只顯示 `關鍵字`。"
config.completion.keywordSnippet.Both =
"顯示 `關鍵字` 與 `語法片段`。"
config.completion.keywordSnippet.Replace =
"只顯示 `語法片段`。"
config.completion.displayContext =
"預覽建議的相關程式碼片段,可能可以幫助你瞭解這項建議的用法。設定的數字表示程式碼片段的擷取行數,設定為 `0` 可以停用此功能。"
config.completion.workspaceWord =
"顯示的上下文單詞是否包含工作區中其他檔案的內容。"
config.completion.showWord =
"在建議中顯示上下文單詞。"
config.completion.showWord.Enable =
"總是在建議中顯示上下文單詞。"
config.completion.showWord.Fallback =
"無法根據語義提供建議時才顯示上下文單詞。"
config.completion.showWord.Disable =
"不顯示上下文單詞。"
config.completion.autoRequire =
"輸入內容看起來像檔名時,自動 `require` 此檔案。"
config.completion.showParams =
"在建議列表中顯示函式的參數資訊,函式擁有多個定義時會分開顯示。"
config.completion.requireSeparator =
"`require` 時使用的分隔符。"
config.completion.postfix =
"用於觸發後綴建議的符號。"
config.color.mode =
"著色模式。"
config.color.mode.Semantic =
"語義著色。你可能需要同時將 `editor.semanticHighlighting.enabled` 設定為 `true` 才能生效。"
config.color.mode.SemanticEnhanced =
"增強的語義顏色。類似於 `Semantic` ,但會進行額外的分析(也會帶來額外的開銷)。"
config.color.mode.Grammar =
"語法著色。"
config.semantic.enable =
"啟用語義著色。你可能需要同時將 `editor.semanticHighlighting.enabled` 設定為 `true` 才能生效。"
config.semantic.variable =
"對變數/欄位/參數進行語義著色。"
config.semantic.annotation =
"對類型註解進行語義著色。"
config.semantic.keyword =
"對關鍵字/字面常數/運算子進行語義著色。只有當你的編輯器無法進行語法著色時才需要啟用此功能。"
config.signatureHelp.enable =
"啟用參數提示。"
config.hover.enable =
"啟用懸浮提示。"
config.hover.viewString =
"懸浮提示檢視字串內容(僅當字面常數包含跳脫字元時)。"
config.hover.viewStringMax =
"懸浮提示檢視字串內容時的最大長度。"
config.hover.viewNumber =
"懸浮提示檢視數字內容(僅當字面常數不是十進制時)。"
config.hover.fieldInfer =
"懸浮提示檢視表時,會對表的每個欄位進行類型推測,當類型推測的用時累計達到該設定值(毫秒)時,將跳過後續欄位的類型推測。"
config.hover.previewFields =
"懸浮提示檢視表時,限制表內欄位的最大預覽數量。"
config.hover.enumsLimit =
"當值對應多個類型時,限制類型的顯示數量。"
config.hover.expandAlias =
[[
是否展開別名。例如 `---@alias myType boolean|number` 展開後顯示為 `boolean|number`,否則顯示為 `myType`'。
]]
config.develop.enable =
'開發者模式。請勿開啟,會影響效能。'
config.develop.debuggerPort =
'除錯器監聽埠。'
config.develop.debuggerWait =
'除錯器連接之前懸置。'
config.intelliSense.searchDepth =
'設定智慧感知的搜尋深度。增大該值可以增加準確度,但會降低效能。不同的工作區對該設定的容忍度差異較大,請自己調整為合適的值。'
config.intelliSense.fastGlobal =
'在對全域變數進行補全,及檢視 `_G` 的懸浮提示時進行最佳化。這會略微降低類型推測的準確度,但是對於大量使用全域變數的專案會有大幅的效能提升。'
config.window.statusBar =
'在狀態欄顯示延伸模組狀態。'
config.window.progressBar =
'在狀態欄顯示進度條。'
config.hint.enable =
'啟用內嵌提示。'
config.hint.paramType =
'在函式的參數位置提示類型。'
config.hint.setType =
'在賦值操作位置提示類型。'
config.hint.paramName =
'在函式呼叫處提示參數名。'
config.hint.paramName.All =
'所有類型的參數均進行提示。'
config.hint.paramName.Literal =
'只有字面常數類型的參數進行提示。'
config.hint.paramName.Disable =
'停用參數提示。'
config.hint.arrayIndex =
'在建構表時提示陣列索引。'
config.hint.arrayIndex.Enable =
'所有的表中都提示陣列索引。'
config.hint.arrayIndex.Auto =
'只有表大於3項或者表是混合類型時才進行提示。'
config.hint.arrayIndex.Disable =
'停用陣列索引提示。'
config.hint.await =
'如果呼叫的函式被標記為了 `---@async`,則在呼叫處提示 `await`。'
config.hint.awaitPropagate =
'啟用 `await` 的傳播,當一個函式呼叫了一個 `---@async` 標記的函式時,會自動標記為 `---@async`。'
config.hint.semicolon =
'若陳述式尾部沒有分號,則顯示虛擬分號。'
config.hint.semicolon.All =
'所有陳述式都顯示虛擬分號。'
config.hint.semicolon.SameLine =
'兩個陳述式在同一行時,在它們之間顯示分號。'
config.hint.semicolon.Disable =
'停用虛擬分號。'
config.codeLens.enable =
'啟用CodeLens。'
config.format.enable =
'啟用程式碼格式化程式。'
config.format.defaultConfig =
[[
預設的格式化組態,優先順序低於工作區內的 `.editorconfig` 檔案。
請查閱[格式化文件](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)了解用法。
]]
config.spell.dict =
'拼寫檢查的自訂單詞。'
config.nameStyle.config = -- TODO: need translate!
[[
設定檢查命名風格的組態。
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
]]
config.telemetry.enable =
[[
啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://luals.github.io/privacy/#language-server)閱讀我們的隱私聲明。
]]
config.misc.parameters =
'VSCode內啟動語言伺服時的[命令列參數](https://luals.github.io/wiki/usage#arguments)。'
config.misc.executablePath =
'指定VSCode內的可執行文件'
config.language.fixIndent =
'僅限VSCode修復自動縮排錯誤例如在有包含 "function" 的字串中換行時出現的錯誤縮排。'
config.language.completeAnnotation =
'僅限VSCode在註解後換行時自動插入 "---@ "。'
config.type.castNumberToInteger =
'允許將 `number` 類型賦值給 `integer` 類型。'
config.type.weakUnionCheck =
[[
同位類型中只要有一個子類型滿足條件,則同位類型也滿足條件。
此設定為 `false` 時,`number|boolean` 類型無法賦值給 `number` 類型;為 `true` 時則可以。
]]
config.type.weakNilCheck =
[[
對同位類型進行類型檢查時,忽略其中的 `nil`。
此設定為 `false` 時,`number|boolean` 類型無法賦值給 `number` 類型;為 `true` 時則可以。
]]
config.type.inferParamType =
[[
未註解參數類型時,參數類型由函式傳入參數推斷。
如果設定為 "false",則在未註解時,參數類型為 "any"。
]]
config.type.checkTableShape =
[[
對表的形狀進行嚴格檢查。
]]
config.type.inferTableSize = -- TODO: need translate!
'Maximum number of table fields analyzed during type inference.'
config.doc.privateName =
'將特定名稱的欄位視為private例如 `m_*` 代表 `XXX.m_id` 和 `XXX.m_type` 會是私有層級,只能在定義所在的類別內存取'
config.doc.protectedName =
'將特定名稱的欄位視為protected例如 `m_*` 代表 `XXX.m_id` 和 `XXX.m_type` 會是保護層級,只能在定義所在的類別和其子類別內存取'
config.doc.packageName =
'將特定名稱的欄位視為package例如 `m_*` 代表 `XXX.m_id` 和 `XXX.m_type` 只能在定義所在的檔案內存取'
config.doc.regengine = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.doc.regengine.glob = -- TODO: need translate!
'The default lightweight pattern syntax.'
config.doc.regengine.lua = -- TODO: need translate!
'Full Lua-style regular expressions.'
config.docScriptPath = -- TODO: need translate!
'The regular expression engine used for matching documentation scope names.'
config.diagnostics['unused-local'] =
'未使用的區域變數'
config.diagnostics['unused-function'] =
'未使用的函式'
config.diagnostics['undefined-global'] =
'未定義的全域變數'
config.diagnostics['global-in-nil-env'] =
'不能使用全域變數( `_ENV` 被設定為 `nil`'
config.diagnostics['unused-label'] =
'未使用的標籤'
config.diagnostics['unused-vararg'] =
'未使用的不定引數'
config.diagnostics['trailing-space'] =
'後置空格'
config.diagnostics['redefined-local'] =
'重複定義的區域變數'
config.diagnostics['newline-call'] =
'以 `(` 開始的新行,在語法上被解析為了上一行的函式呼叫'
config.diagnostics['newfield-call'] =
'在字面常數表中2行程式碼之間缺少分隔符在語法上被解析為了一次索引操作'
config.diagnostics['redundant-parameter'] =
'函式呼叫時,傳入了多餘的引數'
config.diagnostics['ambiguity-1'] =
'優先順序歧義,如: `num or 0 + 1` ,推測使用者的實際期望為 `(num or 0) + 1`'
config.diagnostics['lowercase-global'] =
'首字母小寫的全域變數定義'
config.diagnostics['undefined-env-child'] =
'`_ENV` 被設定為了新的字面常數表,但是試圖獲取的全域變數不在這張表中'
config.diagnostics['duplicate-index'] =
'在字面常數表中重複定義了索引'
config.diagnostics['empty-block'] =
'空程式碼區塊'
config.diagnostics['redundant-value'] =
'賦值操作時,值的數量比被賦值的對象多'
config.diagnostics['assign-type-mismatch'] =
'賦值類型與變數類型不符合'
config.diagnostics['await-in-sync'] =
'同步函式中呼叫非同步函式'
config.diagnostics['cast-local-type'] =
'已顯式定義變數類型不符合要定義的值的類型'
config.diagnostics['cast-type-mismatch'] =
'變數被轉換為不符合其初始類型的類型'
config.diagnostics['circular-doc-class'] =
'兩個類別互相繼承、循環'
config.diagnostics['close-non-object'] =
'嘗試關閉非物件變數'
config.diagnostics['code-after-break'] =
'迴圈內break陳述式後的程式碼'
config.diagnostics['codestyle-check'] =
'行的格式不正確'
config.diagnostics['count-down-loop'] =
'因為 `for` 迴圈是遞增而不是遞減,所以不會到達上限/極限'
config.diagnostics['deprecated'] =
'API已標記deprecated棄用但仍在使用'
config.diagnostics['different-requires'] =
'required的同一個檔案使用了兩個不同的名字'
config.diagnostics['discard-returns'] =
'忽略了標註為 `@nodiscard` 的函式的回傳值'
config.diagnostics['doc-field-no-class'] =
'向沒有標註 `@class` 的類別標註 `@field` 欄位'
config.diagnostics['duplicate-doc-alias'] =
'`@alias` 標註名字衝突'
config.diagnostics['duplicate-doc-field'] =
'`@field` 標註名字衝突'
config.diagnostics['duplicate-doc-param'] =
'`@param` 標註名字衝突'
config.diagnostics['duplicate-set-field'] =
'在類別中多次定義相同的欄位'
config.diagnostics['incomplete-signature-doc'] =
'`@param` 或 `@return` 不完整'
config.diagnostics['invisible'] =
'嘗試存取不可見的欄位'
config.diagnostics['missing-global-doc'] =
'全域變數缺少標註(全域函式必須為所有參數和回傳值提供標註)'
config.diagnostics['missing-local-export-doc'] =
'匯出的區域函式缺少標註(匯出的區域函式、所有的參數和回傳值都必須有標註)'
config.diagnostics['missing-parameter'] =
'函式呼叫的引數數量比函式標註的參數數量少'
config.diagnostics['missing-return'] =
'函式有 `@return` 標註卻沒有 `return` 陳述式'
config.diagnostics['missing-return-value'] =
'函式沒有回傳值,但使用了 `@return` 標註了回傳值'
config.diagnostics['need-check-nil'] =
'變數曾被賦值為 `nil` 或可選值(可能是 `nil` '
config.diagnostics['unnecessary-assert'] =
'對始終為true的陳述式的冗餘斷言'
config.diagnostics['no-unknown'] =
'無法推斷變數的未知類型'
config.diagnostics['not-yieldable'] =
'不允許呼叫 `coroutine.yield()`'
config.diagnostics['param-type-mismatch'] =
'給定參數的類型不符合函式定義所要求的類型( `@param` '
config.diagnostics['redundant-return'] =
'放了一個不需要的 `return` 陳述式,因為函式會自行退出'
config.diagnostics['redundant-return-value']=
'回傳了 `@return` 標註未指定的額外值'
config.diagnostics['return-type-mismatch'] =
'回傳值的類型不符合 `@return` 中宣告的類型'
config.diagnostics['spell-check'] =
'字串拼寫檢查'
config.diagnostics['name-style-check'] =
'變數命名風格檢查'
config.diagnostics['unbalanced-assignments']=
'多重賦值時沒有賦值所有變數(如 `local x,y = 1` '
config.diagnostics['undefined-doc-class'] =
'在 `@class` 標註中引用未定義的類別。'
config.diagnostics['undefined-doc-name'] =
'在 `@type` 標註中引用未定義的類型或 `@alias`'
config.diagnostics['undefined-doc-param'] =
'在 `@param` 標註中引用函式定義未宣告的參數'
config.diagnostics['undefined-field'] =
'讀取變數中為定義的欄位'
config.diagnostics['unknown-cast-variable'] =
'使用 `@cast` 對未定義的變數進行強制轉換'
config.diagnostics['unknown-diag-code'] =
'輸入了未知的診斷'
config.diagnostics['unknown-operator'] =
'未知的運算子'
config.diagnostics['unreachable-code'] =
'無法到達的程式碼'
config.diagnostics['global-element'] =
'對全域元素的警告'
config.typeFormat.config =
'寫Lua程式碼時的格式化組態'
config.typeFormat.config.auto_complete_end =
'是否在合適的位置自動完成 `end`'
config.typeFormat.config.auto_complete_table_sep =
'是否在宣告表的結尾自動添加分隔符號'
config.typeFormat.config.format_line =
'是否格式化某一行'
command.exportDocument =
'Lua輸出文件…'
command.addon_manager.open =
'Lua打開插件管理器Addon Manager'
command.reloadFFIMeta =
'Lua重新生成luajit的FFI模組C語言中繼資料'
command.startServer =
'Lua除錯重新啟動語言伺服'
command.stopServer =
'Lua除錯停止語言伺服'