Convert yadm changes back to Makefile-based system
This commit is contained in:
parent
52deaa9493
commit
9c1dd1ce27
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -8,5 +8,3 @@ plugin
|
|||
state.yml
|
||||
# For pynvim environment
|
||||
venv
|
||||
lua-lsp/log
|
||||
lua-lsp/meta
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,8 @@
|
|||
[ -f "$HOME/.profile" ] && source "$HOME/.profile"
|
||||
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
|
||||
if [[ -e $HOME/.ssh/id_ed25519 ]]
|
||||
then
|
||||
command -v keychain > /dev/null && eval $(keychain --eval --quiet --noask $HOME/.ssh/id_ed25519)
|
||||
fi
|
||||
|
|
|
@ -5,9 +5,6 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
|||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
|
||||
|
@ -28,12 +25,12 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # set by `omz`
|
|||
|
||||
# Uncomment the following line to use hyphen-insensitive completion.
|
||||
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
||||
# HYPHEN_INSENSITIVE="true"
|
||||
HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment one of the following lines to change the auto-update behavior
|
||||
# zstyle ':omz:update' mode disabled # disable automatic updates
|
||||
# zstyle ':omz:update' mode auto # update automatically without asking
|
||||
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
||||
zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# zstyle ':omz:update' frequency 13
|
||||
|
@ -54,7 +51,7 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # set by `omz`
|
|||
# You can also set it to another string to have that shown instead of the default red dots.
|
||||
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
|
||||
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
|
@ -67,7 +64,7 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # set by `omz`
|
|||
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||
# or set a custom format using the strftime function format specifications,
|
||||
# see 'man strftime' for details.
|
||||
# HIST_STAMPS="mm/dd/yyyy"
|
||||
HIST_STAMPS="yyyy-mm-dd"
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
# ZSH_CUSTOM=/path/to/new-custom-folder
|
||||
|
@ -77,35 +74,44 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # set by `omz`
|
|||
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(git fzf pyenv poetry)
|
||||
plugins=(git fzf safe-paste colored-man-pages archlinux brew macos)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# User configuration
|
||||
|
||||
# export MANPATH="/usr/local/man:$MANPATH"
|
||||
export EDITOR="nvim"
|
||||
export VISUAL="nvim"
|
||||
|
||||
# You may need to manually set your language environment
|
||||
# export LANG=en_US.UTF-8
|
||||
LOCAL_BIN="$HOME/.local/bin"
|
||||
echo $PATH | grep -i "$LOCAL_BIN" - > /dev/null || export PATH=$PATH:$LOCAL_BIN
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='mvim'
|
||||
# fi
|
||||
vim ()
|
||||
{
|
||||
poetry env info > /dev/null 2>&1 && poetry run nvim $@ || nvim $@
|
||||
}
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
alias nvimdiff="nvim -d"
|
||||
alias lg="lazygit"
|
||||
command -v yadm > /dev/null && {
|
||||
alias yvi="yadm enter nvim"
|
||||
alias ylg="yadm enter lazygit"
|
||||
alias yss="yadm status"
|
||||
}
|
||||
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
|
||||
|
||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
||||
# For a full list of active aliases, run `alias`.
|
||||
#
|
||||
# Example aliases
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||
autoload -U bashcompinit
|
||||
bashcompinit
|
||||
command -v pipx > /dev/null && {
|
||||
command -v register-python-argcomplete3 > /dev/null && eval "$(register-python-argcomplete3 pipx)"
|
||||
command -v register-python-argcomplete > /dev/null && eval "$(register-python-argcomplete pipx)"
|
||||
}
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
__prompt_to_bottom_line() {
|
||||
tput cup $LINES
|
||||
}
|
||||
alias clear='clear && __prompt_to_bottom_line'
|
||||
__prompt_to_bottom_line
|
19
Makefile
19
Makefile
|
@ -6,8 +6,6 @@ ZSH_CUSTOM_DIR := $(if $(ZSH_CUSTOM), $(ZSH_CUSTOM), $(ZSH_DIR)/custom)
|
|||
|
||||
CONFIG_ITEMS := $(wildcard config/*)
|
||||
CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%)
|
||||
FONT_ITEMS := $(wildcard nerdfont_symbols/*)
|
||||
FONT_TARGETS := $(FONT_ITEMS:nerdfont_symbols/%=$(FONT_DIR)/%)
|
||||
ZSH_ITEMS := $(wildcard ohmyzsh/*.zsh)
|
||||
ZSH_TARGETS := $(ZSH_ITEMS:ohmyzsh/%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh)
|
||||
|
||||
|
@ -16,13 +14,17 @@ PACKER_DIR := $(HOME)/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|||
POWERLEVEL_REPO := https://github.com/romkatv/powerlevel10k.git
|
||||
POWERLEVEL_DIR := $(ZSH_CUSTOM_DIR)/themes/powerlevel10k
|
||||
|
||||
.PHONY := config clean zsh ssh nvim
|
||||
.PHONY := all config packages clean zsh ssh nvim
|
||||
|
||||
install: config packages
|
||||
|
||||
config: $(CONFIG_TARGETS) zsh ssh nvim
|
||||
|
||||
packages:
|
||||
sudo pacman --needed -S - < pkglist.txt
|
||||
|
||||
clean:
|
||||
for link in $(CONFIG_TARGETS); do rm "$$link"; done
|
||||
for link in $(FONT_TARGETS); do rm "$$link"; done
|
||||
for link in $(ZSH_TARGETS); do rm "$$link"; done
|
||||
rm $(HOME)/.zprofile
|
||||
rm $(HOME)/.zshrc
|
||||
|
@ -38,13 +40,12 @@ ssh: $(HOME)/.ssh/config $(HOME)/.ssh/sockets $(HOME)/.ssh/config.d
|
|||
nvim: $(PACKER_DIR)
|
||||
|
||||
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
||||
$(FONT_TARGETS): $(FONT_DIR)/%: nerdfont_symbols/%
|
||||
$(ZSH_TARGETS): $(ZSH_CUSTOM_DIR)/%.zsh: ohmyzsh/%.zsh
|
||||
$(HOME)/.zprofile: .zprofile
|
||||
$(HOME)/.zshrc: zshrc
|
||||
$(HOME)/.p10k.zsh: p10k.zsh
|
||||
$(HOME)/.zshrc: .zshrc
|
||||
$(HOME)/.p10k.zsh: .p10k.zsh
|
||||
$(HOME)/.ssh/config: $(HOME)/.ssh/%: ssh-%
|
||||
$(CONFIG_TARGETS) $(FONT_TARGETS) $(ZSH_TARGETS) $(HOME)/.zprofile $(HOME)/.zshrc $(HOME)/.p10k.zsh $(HOME)/.ssh/config:
|
||||
$(CONFIG_TARGETS) $(ZSH_TARGETS) $(HOME)/.zprofile $(HOME)/.zshrc $(HOME)/.p10k.zsh $(HOME)/.ssh/config:
|
||||
ln -s $(PWD)/$? $@
|
||||
|
||||
$(PACKER_DIR):
|
||||
|
@ -55,7 +56,7 @@ $(ZSH_DIR):
|
|||
|
||||
$(ZSH_CUSTOM_DIR): $(ZSH_DIR)
|
||||
|
||||
$(POWERLEVEL_DIR):
|
||||
$(POWERLEVEL_DIR): $(ZSH_CUSTOM_DIR)
|
||||
git clone --depth 1 $(POWERLEVEL_REPO) $@
|
||||
|
||||
$(LOCAL_BIN) $(CONFIG_DIR) $(FONT_DIR) $(HOME)/.ssh $(HOME)/.ssh/sockets $(HOME)/.ssh/config.d:
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
exec "$(dirname $(dirname $(readlink -f $0)))/lua-lsp/bin/lua-language-server" "$@"
|
BIN
bin/texlab
BIN
bin/texlab
Binary file not shown.
BIN
bin/tree-sitter
BIN
bin/tree-sitter
Binary file not shown.
|
@ -1,8 +1,10 @@
|
|||
[include]
|
||||
path = user
|
||||
|
||||
[core]
|
||||
editor = nvim
|
||||
[user]
|
||||
name = Evie Litherland-Smith
|
||||
autocrlf = input
|
||||
[pull]
|
||||
rebase = false
|
||||
[diff]
|
||||
tool = nvimdiff
|
||||
[color]
|
||||
ui = true
|
||||
|
|
3
config/git/user
Normal file
3
config/git/user
Normal file
|
@ -0,0 +1,3 @@
|
|||
[user]
|
||||
name = Evie Litherland-Smith
|
||||
email = e.litherlandsmith@icloud.com
|
|
@ -1,28 +0,0 @@
|
|||
# endeavourOS colors for Kitty
|
||||
# Taken from eOS default XFCE4 terminal setup
|
||||
|
||||
background #08052B
|
||||
foreground #E3E3EA
|
||||
cursor #FFFFFF
|
||||
|
||||
# normal
|
||||
color0 #08052B
|
||||
color1 #FF7F7F
|
||||
color2 #7F3FBF
|
||||
color3 #CC3980
|
||||
color4 #7FBAFF
|
||||
color5 #7F3FBF
|
||||
color6 #7F7FFF
|
||||
color7 #CDCCDB
|
||||
|
||||
# bright
|
||||
color8 #7FBAFF
|
||||
color9 #FF7F7F
|
||||
color10 #9999CC
|
||||
color11 #FF7F7F
|
||||
color12 #7F7FFF
|
||||
color13 #7F3FBF
|
||||
color14 #7F7FFF
|
||||
color15 #E3E3EA
|
||||
|
||||
background_opacity 0.92
|
File diff suppressed because it is too large
Load diff
|
@ -1,40 +0,0 @@
|
|||
# onedark colors for Kitty
|
||||
|
||||
background #282c34
|
||||
foreground #abb2bf
|
||||
selection_background #393f4a
|
||||
selection_foreground #abb2bf
|
||||
url_color #98c379
|
||||
cursor #abb2bf
|
||||
|
||||
# Tabs
|
||||
active_tab_background #282c34
|
||||
active_tab_foreground #abb2bf
|
||||
inactive_tab_background #242b38
|
||||
inactive_tab_foreground #5c6370
|
||||
#tab_bar_background #20232A
|
||||
|
||||
# normal
|
||||
color0 #20232A
|
||||
color1 #e86671
|
||||
color2 #98c379
|
||||
color3 #e0af68
|
||||
color4 #61afef
|
||||
color5 #c678dd
|
||||
color6 #56b6c2
|
||||
color7 #798294
|
||||
|
||||
# bright
|
||||
color8 #5c6370
|
||||
color9 #e86671
|
||||
color10 #98c379
|
||||
color11 #e0af68
|
||||
color12 #61afef
|
||||
color13 #c678dd
|
||||
color14 #56b6c2
|
||||
color15 #abb2bf
|
||||
|
||||
# extended colors
|
||||
color16 #d19a66
|
||||
color17 #f65866
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
gui:
|
||||
showFileTree: false
|
||||
showFileTree: true
|
||||
showCommandLog: false
|
||||
showIcons: true
|
||||
promptToReturnFromSubprocess: false
|
||||
|
|
468
config/nvim/lua/config/feline.lua
Normal file
468
config/nvim/lua/config/feline.lua
Normal file
|
@ -0,0 +1,468 @@
|
|||
-- Feline
|
||||
-- https://github.com/EdenEast/nightfox.nvim/blob/main/mics/feline.lua
|
||||
--
|
||||
-- This file is a complete example of creating the feline configuration shown in the readme of
|
||||
-- nightfox. This configuration generates its own highlight groups from the currently applied
|
||||
-- colorscheme. These highlight groups are regenreated on colorscheme changes.
|
||||
--
|
||||
-- Required plugins:
|
||||
-- - `feline-nvim/feline.nvim`
|
||||
-- - `kyazdani42/nvim-web-devicons`
|
||||
--
|
||||
-- This file is required to be in your `lua` folder of your config. Your colorscheme should also
|
||||
-- be applied before this file is sourced. This file cannot be located `lua/feline.lua` as this
|
||||
-- would clash with the actual plugin require path.
|
||||
--
|
||||
-- # Example:
|
||||
--
|
||||
-- ```lua
|
||||
-- vim.cmd("colorscheme nightfox")
|
||||
-- require('user.ui.feline')
|
||||
-- ```
|
||||
--
|
||||
-- This assumes that this file is located at `lua/user/ui/feline.lua`
|
||||
|
||||
local fmt = string.format
|
||||
|
||||
----------------------------------------------------------------------------------------------------
|
||||
-- Colors
|
||||
|
||||
---Convert color number to hex string
|
||||
---@param n number
|
||||
---@return string
|
||||
local hex = function(n)
|
||||
if n then
|
||||
return fmt("#%06x", n)
|
||||
end
|
||||
end
|
||||
|
||||
---Parse `style` string into nvim_set_hl options
|
||||
---@param style string
|
||||
---@return table
|
||||
local function parse_style(style)
|
||||
if not style or style == "NONE" then
|
||||
return {}
|
||||
end
|
||||
|
||||
local result = {}
|
||||
for token in string.gmatch(style, "([^,]+)") do
|
||||
result[token] = true
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
---Get highlight opts for a given highlight group name
|
||||
---@param name string
|
||||
---@return table
|
||||
local function get_highlight(name)
|
||||
local hl = vim.api.nvim_get_hl_by_name(name, true)
|
||||
if hl.link then
|
||||
return get_highlight(hl.link)
|
||||
end
|
||||
|
||||
local result = parse_style(hl.style)
|
||||
result.fg = hl.foreground and hex(hl.foreground)
|
||||
result.bg = hl.background and hex(hl.background)
|
||||
result.sp = hl.special and hex(hl.special)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
---Set highlight group from provided table
|
||||
---@param groups table
|
||||
local function set_highlights(groups)
|
||||
for group, opts in pairs(groups) do
|
||||
vim.api.nvim_set_hl(0, group, opts)
|
||||
end
|
||||
end
|
||||
|
||||
---Generate a color palette from the current applied colorscheme
|
||||
---@return table
|
||||
local function generate_pallet_from_colorscheme()
|
||||
-- stylua: ignore
|
||||
local color_map = {
|
||||
black = { index = 0, default = "#393b44" },
|
||||
red = { index = 1, default = "#c94f6d" },
|
||||
green = { index = 2, default = "#81b29a" },
|
||||
yellow = { index = 3, default = "#dbc074" },
|
||||
blue = { index = 4, default = "#719cd6" },
|
||||
magenta = { index = 5, default = "#9d79d6" },
|
||||
cyan = { index = 6, default = "#63cdcf" },
|
||||
white = { index = 7, default = "#dfdfe0" },
|
||||
}
|
||||
|
||||
local diagnostic_map = {
|
||||
hint = { hl = "DiagnosticHint", default = color_map.green.default },
|
||||
info = { hl = "DiagnosticInfo", default = color_map.blue.default },
|
||||
warn = { hl = "DiagnosticWarn", default = color_map.yellow.default },
|
||||
error = { hl = "DiagnosticError", default = color_map.red.default },
|
||||
}
|
||||
|
||||
local pallet = {}
|
||||
for name, value in pairs(color_map) do
|
||||
local global_name = "terminal_color_" .. value.index
|
||||
pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default
|
||||
end
|
||||
|
||||
for name, value in pairs(diagnostic_map) do
|
||||
pallet[name] = get_highlight(value.hl).fg or value.default
|
||||
end
|
||||
|
||||
pallet.sl = get_highlight("StatusLine")
|
||||
pallet.sel = get_highlight("TabLineSel")
|
||||
|
||||
return pallet
|
||||
end
|
||||
|
||||
---Generate user highlight groups based on the curent applied colorscheme
|
||||
---
|
||||
---NOTE: This is a global because I dont known where this file will be in your config
|
||||
---and it is needed for the autocmd below
|
||||
_G._generate_user_statusline_highlights = function()
|
||||
local pal = generate_pallet_from_colorscheme()
|
||||
|
||||
-- stylua: ignore
|
||||
local sl_colors = {
|
||||
Black = { fg = pal.black, bg = pal.white },
|
||||
Red = { fg = pal.red, bg = pal.sl.bg },
|
||||
Green = { fg = pal.green, bg = pal.sl.bg },
|
||||
Yellow = { fg = pal.yellow, bg = pal.sl.bg },
|
||||
Blue = { fg = pal.blue, bg = pal.sl.bg },
|
||||
Magenta = { fg = pal.magenta, bg = pal.sl.bg },
|
||||
Cyan = { fg = pal.cyan, bg = pal.sl.bg },
|
||||
White = { fg = pal.white, bg = pal.black },
|
||||
}
|
||||
|
||||
local colors = {}
|
||||
for name, value in pairs(sl_colors) do
|
||||
colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true }
|
||||
colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true }
|
||||
end
|
||||
|
||||
local status = vim.o.background == "dark" and { fg = pal.black, bg = pal.white } or { fg = pal.white, bg = pal.black }
|
||||
|
||||
local groups = {
|
||||
-- statusline
|
||||
UserSLHint = { fg = pal.sl.bg, bg = pal.hint, bold = true },
|
||||
UserSLInfo = { fg = pal.sl.bg, bg = pal.info, bold = true },
|
||||
UserSLWarn = { fg = pal.sl.bg, bg = pal.warn, bold = true },
|
||||
UserSLError = { fg = pal.sl.bg, bg = pal.error, bold = true },
|
||||
UserSLStatus = { fg = status.fg, bg = status.bg, bold = true },
|
||||
|
||||
UserSLFtHint = { fg = pal.sel.bg, bg = pal.hint },
|
||||
UserSLHintInfo = { fg = pal.hint, bg = pal.info },
|
||||
UserSLInfoWarn = { fg = pal.info, bg = pal.warn },
|
||||
UserSLWarnError = { fg = pal.warn, bg = pal.error },
|
||||
UserSLErrorStatus = { fg = pal.error, bg = status.bg },
|
||||
UserSLStatusBg = { fg = status.bg, bg = pal.sl.bg },
|
||||
|
||||
UserSLAlt = pal.sel,
|
||||
UserSLAltSep = { fg = pal.sl.bg, bg = pal.sel.bg },
|
||||
UserSLGitBranch = { fg = pal.yellow, bg = pal.sl.bg },
|
||||
}
|
||||
|
||||
set_highlights(vim.tbl_extend("force", colors, groups))
|
||||
end
|
||||
|
||||
_generate_user_statusline_highlights()
|
||||
|
||||
vim.api.nvim_create_augroup("UserStatuslineHighlightGroups", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, {
|
||||
callback = function()
|
||||
_generate_user_statusline_highlights()
|
||||
end,
|
||||
})
|
||||
|
||||
----------------------------------------------------------------------------------------------------
|
||||
-- Feline
|
||||
|
||||
local vi = {
|
||||
-- Map vi mode to text name
|
||||
text = {
|
||||
n = "NORMAL",
|
||||
no = "NORMAL",
|
||||
i = "INSERT",
|
||||
v = "VISUAL",
|
||||
V = "V-LINE",
|
||||
[""] = "V-BLOCK",
|
||||
c = "COMMAND",
|
||||
cv = "COMMAND",
|
||||
ce = "COMMAND",
|
||||
R = "REPLACE",
|
||||
Rv = "REPLACE",
|
||||
s = "SELECT",
|
||||
S = "SELECT",
|
||||
[""] = "SELECT",
|
||||
t = "TERMINAL",
|
||||
},
|
||||
|
||||
-- Maps vi mode to highlight group color defined above
|
||||
colors = {
|
||||
n = "UserRvCyan",
|
||||
no = "UserRvCyan",
|
||||
i = "UserSLStatus",
|
||||
v = "UserRvMagenta",
|
||||
V = "UserRvMagenta",
|
||||
[""] = "UserRvMagenta",
|
||||
R = "UserRvRed",
|
||||
Rv = "UserRvRed",
|
||||
r = "UserRvBlue",
|
||||
rm = "UserRvBlue",
|
||||
s = "UserRvMagenta",
|
||||
S = "UserRvMagenta",
|
||||
[""] = "FelnMagenta",
|
||||
c = "UserRvYellow",
|
||||
["!"] = "UserRvBlue",
|
||||
t = "UserRvBlue",
|
||||
},
|
||||
|
||||
-- Maps vi mode to seperator highlight goup defined above
|
||||
sep = {
|
||||
n = "UserCyan",
|
||||
no = "UserCyan",
|
||||
i = "UserSLStatusBg",
|
||||
v = "UserMagenta",
|
||||
V = "UserMagenta",
|
||||
[""] = "UserMagenta",
|
||||
R = "UserRed",
|
||||
Rv = "UserRed",
|
||||
r = "UserBlue",
|
||||
rm = "UserBlue",
|
||||
s = "UserMagenta",
|
||||
S = "UserMagenta",
|
||||
[""] = "FelnMagenta",
|
||||
c = "UserYellow",
|
||||
["!"] = "UserBlue",
|
||||
t = "UserBlue",
|
||||
},
|
||||
}
|
||||
|
||||
local icons = {
|
||||
locker = "", -- #f023
|
||||
page = "☰", -- 2630
|
||||
line_number = "", -- e0a1
|
||||
connected = "", -- f817
|
||||
dos = "", -- e70f
|
||||
unix = "", -- f17c
|
||||
mac = "", -- f179
|
||||
mathematical_L = "𝑳",
|
||||
vertical_bar = "┃",
|
||||
vertical_bar_thin = "│",
|
||||
left = "",
|
||||
right = "",
|
||||
block = "█",
|
||||
left_filled = "",
|
||||
right_filled = "",
|
||||
slant_left = "",
|
||||
slant_left_thin = "",
|
||||
slant_right = "",
|
||||
slant_right_thin = "",
|
||||
slant_left_2 = "",
|
||||
slant_left_2_thin = "",
|
||||
slant_right_2 = "",
|
||||
slant_right_2_thin = "",
|
||||
left_rounded = "",
|
||||
left_rounded_thin = "",
|
||||
right_rounded = "",
|
||||
right_rounded_thin = "",
|
||||
circle = "●",
|
||||
}
|
||||
|
||||
---Get the number of diagnostic messages for the provided severity
|
||||
---@param str string [ERROR | WARN | INFO | HINT]
|
||||
---@return string
|
||||
local function get_diag(str)
|
||||
local diagnostics = vim.diagnostic.get(0, { severity = vim.diagnostic.severity[str] })
|
||||
local count = #diagnostics
|
||||
|
||||
return (count > 0) and " " .. count .. " " or ""
|
||||
end
|
||||
|
||||
---Get highlight group from vi mode
|
||||
---@return string
|
||||
local function vi_mode_hl()
|
||||
return vi.colors[vim.fn.mode()] or "UserSLViBlack"
|
||||
end
|
||||
|
||||
---Get sep highlight group from vi mode
|
||||
local function vi_sep_hl()
|
||||
return vi.sep[vim.fn.mode()] or "UserSLBlack"
|
||||
end
|
||||
|
||||
---Get the path of the file relative to the cwd
|
||||
---@return string
|
||||
local function file_info()
|
||||
local list = {}
|
||||
if vim.bo.readonly then
|
||||
table.insert(list, "🔒")
|
||||
end
|
||||
|
||||
if vim.bo.modified then
|
||||
table.insert(list, "●")
|
||||
end
|
||||
|
||||
table.insert(list, vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":~:."))
|
||||
|
||||
return table.concat(list, " ")
|
||||
end
|
||||
|
||||
-- Create a table that contians every status line commonent
|
||||
local c = {
|
||||
vimode = {
|
||||
provider = function()
|
||||
return fmt(" %s ", vi.text[vim.fn.mode()])
|
||||
end,
|
||||
hl = vi_mode_hl,
|
||||
right_sep = { str = " ", hl = vi_sep_hl },
|
||||
},
|
||||
gitbranch = {
|
||||
provider = "git_branch",
|
||||
icon = " ",
|
||||
hl = "UserSLGitBranch",
|
||||
right_sep = { str = " ", hl = "UserSLGitBranch" },
|
||||
enabled = function()
|
||||
return vim.b.gitsigns_status_dict ~= nil
|
||||
end,
|
||||
},
|
||||
file_type = {
|
||||
provider = function()
|
||||
return fmt(" %s ", vim.bo.filetype:upper())
|
||||
end,
|
||||
hl = "UserSLAlt",
|
||||
},
|
||||
fileinfo = {
|
||||
provider = { name = "file_info", opts = { type = "relative" } },
|
||||
hl = "UserSLAlt",
|
||||
left_sep = { str = " ", hl = "UserSLAltSep" },
|
||||
right_sep = { str = " ", hl = "UserSLAltSep" },
|
||||
},
|
||||
file_enc = {
|
||||
provider = function()
|
||||
local os = icons[vim.bo.fileformat] or ""
|
||||
return fmt(" %s %s ", os, vim.bo.fileencoding)
|
||||
end,
|
||||
hl = "StatusLine",
|
||||
left_sep = { str = icons.left_filled, hl = "UserSLAltSep" },
|
||||
},
|
||||
cur_position = {
|
||||
provider = function()
|
||||
-- TODO: What about 4+ diget line numbers?
|
||||
return fmt(" %3d:%-2d ", unpack(vim.api.nvim_win_get_cursor(0)))
|
||||
end,
|
||||
hl = vi_mode_hl,
|
||||
left_sep = { str = icons.left_filled, hl = vi_sep_hl },
|
||||
},
|
||||
cur_percent = {
|
||||
provider = function()
|
||||
return " " .. require("feline.providers.cursor").line_percentage() .. " "
|
||||
end,
|
||||
hl = vi_mode_hl,
|
||||
left_sep = { str = icons.left, hl = vi_mode_hl },
|
||||
},
|
||||
default = { -- needed to pass the parent StatusLine hl group to right hand side
|
||||
provider = "",
|
||||
hl = "StatusLine",
|
||||
},
|
||||
lsp_status = {
|
||||
provider = function()
|
||||
return vim.tbl_count(vim.lsp.buf_get_clients(0)) == 0 and "" or " ◦ "
|
||||
end,
|
||||
hl = "UserSLStatus",
|
||||
left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true },
|
||||
right_sep = { str = "", hl = "UserSLErrorStatus", always_visible = true },
|
||||
},
|
||||
lsp_error = {
|
||||
provider = function()
|
||||
return get_diag("ERROR")
|
||||
end,
|
||||
hl = "UserSLError",
|
||||
right_sep = { str = "", hl = "UserSLWarnError", always_visible = true },
|
||||
},
|
||||
lsp_warn = {
|
||||
provider = function()
|
||||
return get_diag("WARN")
|
||||
end,
|
||||
hl = "UserSLWarn",
|
||||
right_sep = { str = "", hl = "UserSLInfoWarn", always_visible = true },
|
||||
},
|
||||
lsp_info = {
|
||||
provider = function()
|
||||
return get_diag("INFO")
|
||||
end,
|
||||
hl = "UserSLInfo",
|
||||
right_sep = { str = "", hl = "UserSLHintInfo", always_visible = true },
|
||||
},
|
||||
lsp_hint = {
|
||||
provider = function()
|
||||
return get_diag("HINT")
|
||||
end,
|
||||
hl = "UserSLHint",
|
||||
right_sep = { str = "", hl = "UserSLFtHint", always_visible = true },
|
||||
},
|
||||
|
||||
in_fileinfo = {
|
||||
provider = "file_info",
|
||||
hl = "StatusLine",
|
||||
},
|
||||
in_position = {
|
||||
provider = "position",
|
||||
hl = "StatusLine",
|
||||
},
|
||||
file_winbar = {
|
||||
provider = file_info,
|
||||
hl = "Comment",
|
||||
},
|
||||
}
|
||||
|
||||
local active = {
|
||||
{ -- left
|
||||
c.vimode,
|
||||
c.gitbranch,
|
||||
c.fileinfo,
|
||||
c.default, -- must be last
|
||||
},
|
||||
{ -- right
|
||||
c.lsp_status,
|
||||
c.lsp_error,
|
||||
c.lsp_warn,
|
||||
c.lsp_info,
|
||||
c.lsp_hint,
|
||||
c.file_type,
|
||||
c.file_enc,
|
||||
c.cur_position,
|
||||
c.cur_percent,
|
||||
},
|
||||
}
|
||||
|
||||
local inactive = {
|
||||
{ c.in_fileinfo }, -- left
|
||||
{ c.in_position }, -- right
|
||||
}
|
||||
|
||||
require("feline").setup({
|
||||
components = { active = active, inactive = inactive },
|
||||
highlight_reset_triggers = {},
|
||||
force_inactive = {
|
||||
filetypes = {
|
||||
"NvimTree",
|
||||
"packer",
|
||||
"dap-repl",
|
||||
"dapui_scopes",
|
||||
"dapui_stacks",
|
||||
"dapui_watches",
|
||||
"dapui_repl",
|
||||
"LspTrouble",
|
||||
"qf",
|
||||
"help",
|
||||
},
|
||||
buftypes = { "terminal" },
|
||||
bufnames = {},
|
||||
},
|
||||
disable = {
|
||||
filetypes = {
|
||||
"dashboard",
|
||||
"startify",
|
||||
},
|
||||
},
|
||||
})
|
8
config/nvim/lua/config/fidget.lua
Normal file
8
config/nvim/lua/config/fidget.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
require('fidget').setup{
|
||||
text = {
|
||||
spinner = "dots",
|
||||
},
|
||||
window = {
|
||||
blend = 0,
|
||||
},
|
||||
}
|
|
@ -86,18 +86,15 @@ require('lspconfig')['sumneko_lua'].setup {
|
|||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
7
config/nvim/lua/config/nightfox.lua
Normal file
7
config/nvim/lua/config/nightfox.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
require('nightfox').setup {
|
||||
options = {
|
||||
transparent = true,
|
||||
},
|
||||
}
|
||||
require('nightfox').compile()
|
||||
vim.cmd("colorscheme nightfox")
|
220
config/nvim/lua/config/tabby.lua
Normal file
220
config/nvim/lua/config/tabby.lua
Normal file
|
@ -0,0 +1,220 @@
|
|||
-- Tabby
|
||||
-- https://github.com/UserEast/nightfox.nvim/tree/main/mics/tabby.lua
|
||||
--
|
||||
-- This file is a complete example of creating the tabby configuration shown in the readme of
|
||||
-- nightfox. This configuration generates its own highlight groups from the currently applied
|
||||
-- colorscheme. These highlight groups are regenreated on colorscheme changes.
|
||||
--
|
||||
-- Required plugins:
|
||||
-- - `nanozuki/tabby.nvim`
|
||||
--
|
||||
-- This file is required to be in your `lua` folder of your config. Your colorscheme should also
|
||||
-- be applied before this file is sourced. This file cannot be located `lua/tabby.lua` as this
|
||||
-- would clash with the actual plugin require path.
|
||||
--
|
||||
--
|
||||
-- # Example:
|
||||
--
|
||||
-- ```lua
|
||||
-- vim.cmd("colorscheme nightfox")
|
||||
-- require('user.ui.tabby')
|
||||
-- ```
|
||||
--
|
||||
-- This assumes that this file is located at `lua/user/ui/tabby.lua`
|
||||
|
||||
local fmt = string.format
|
||||
|
||||
----------------------------------------------------------------------------------------------------
|
||||
-- Colors
|
||||
|
||||
---Convert color number to hex string
|
||||
---@param n number
|
||||
---@return string
|
||||
local hex = function(n)
|
||||
if n then
|
||||
return fmt("#%06x", n)
|
||||
end
|
||||
end
|
||||
|
||||
---Parse `style` string into nvim_set_hl options
|
||||
---@param style string
|
||||
---@return table
|
||||
local function parse_style(style)
|
||||
if not style or style == "NONE" then
|
||||
return {}
|
||||
end
|
||||
|
||||
local result = {}
|
||||
for token in string.gmatch(style, "([^,]+)") do
|
||||
result[token] = true
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
---Get highlight opts for a given highlight group name
|
||||
---@param name string
|
||||
---@return table
|
||||
local function get_highlight(name)
|
||||
local hl = vim.api.nvim_get_hl_by_name(name, true)
|
||||
if hl.link then
|
||||
return get_highlight(hl.link)
|
||||
end
|
||||
|
||||
local result = parse_style(hl.style)
|
||||
result.fg = hl.foreground and hex(hl.foreground)
|
||||
result.bg = hl.background and hex(hl.background)
|
||||
result.sp = hl.special and hex(hl.special)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
---Set highlight group from provided table
|
||||
---@param groups table
|
||||
local function set_highlights(groups)
|
||||
for group, opts in pairs(groups) do
|
||||
vim.api.nvim_set_hl(0, group, opts)
|
||||
end
|
||||
end
|
||||
|
||||
---Generate a color palette from the current applied colorscheme
|
||||
---@return table
|
||||
local function generate_pallet_from_colorscheme()
|
||||
-- stylua: ignore
|
||||
local color_map = {
|
||||
black = { index = 0, default = "#393b44" },
|
||||
red = { index = 1, default = "#c94f6d" },
|
||||
green = { index = 2, default = "#81b29a" },
|
||||
yellow = { index = 3, default = "#dbc074" },
|
||||
blue = { index = 4, default = "#719cd6" },
|
||||
magenta = { index = 5, default = "#9d79d6" },
|
||||
cyan = { index = 6, default = "#63cdcf" },
|
||||
white = { index = 7, default = "#dfdfe0" },
|
||||
}
|
||||
|
||||
local pallet = {}
|
||||
for name, value in pairs(color_map) do
|
||||
local global_name = "terminal_color_" .. value.index
|
||||
pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default
|
||||
end
|
||||
|
||||
pallet.sl = get_highlight("StatusLine")
|
||||
pallet.tab = get_highlight("TabLine")
|
||||
pallet.sel = get_highlight("TabLineSel")
|
||||
pallet.fill = get_highlight("TabLineFill")
|
||||
|
||||
return pallet
|
||||
end
|
||||
|
||||
---Generate user highlight groups based on the curent applied colorscheme
|
||||
---
|
||||
---NOTE: This is a global because I dont known where this file will be in your config
|
||||
---and it is needed for the autocmd below
|
||||
_G._genreate_user_tabline_highlights = function()
|
||||
local pal = generate_pallet_from_colorscheme()
|
||||
|
||||
-- stylua: ignore
|
||||
local sl_colors = {
|
||||
Black = { fg = pal.black, bg = pal.white },
|
||||
Red = { fg = pal.red, bg = pal.sl.bg },
|
||||
Green = { fg = pal.green, bg = pal.sl.bg },
|
||||
Yellow = { fg = pal.yellow, bg = pal.sl.bg },
|
||||
Blue = { fg = pal.blue, bg = pal.sl.bg },
|
||||
Magenta = { fg = pal.magenta, bg = pal.sl.bg },
|
||||
Cyan = { fg = pal.cyan, bg = pal.sl.bg },
|
||||
White = { fg = pal.white, bg = pal.black },
|
||||
}
|
||||
|
||||
local colors = {}
|
||||
for name, value in pairs(sl_colors) do
|
||||
colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true }
|
||||
colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true }
|
||||
end
|
||||
|
||||
local groups = {
|
||||
-- tabline
|
||||
UserTLHead = { fg = pal.fill.bg, bg = pal.cyan },
|
||||
UserTLHeadSep = { fg = pal.cyan, bg = pal.fill.bg },
|
||||
UserTLActive = { fg = pal.sel.fg, bg = pal.sel.bg, bold = true },
|
||||
UserTLActiveSep = { fg = pal.sel.bg, bg = pal.fill.bg },
|
||||
UserTLBoldLine = { fg = pal.tab.fg, bg = pal.tab.bg, bold = true },
|
||||
UserTLLineSep = { fg = pal.tab.bg, bg = pal.fill.bg },
|
||||
}
|
||||
|
||||
set_highlights(vim.tbl_extend("force", colors, groups))
|
||||
end
|
||||
|
||||
_genreate_user_tabline_highlights()
|
||||
|
||||
vim.api.nvim_create_augroup("UserTablineHighlightGroups", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, {
|
||||
callback = function()
|
||||
_genreate_user_tabline_highlights()
|
||||
end,
|
||||
})
|
||||
|
||||
----------------------------------------------------------------------------------------------------
|
||||
-- Feline
|
||||
|
||||
local filename = require("tabby.filename")
|
||||
|
||||
local cwd = function()
|
||||
return " " .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") .. " "
|
||||
end
|
||||
|
||||
local line = {
|
||||
hl = "TabLineFill",
|
||||
layout = "active_wins_at_tail",
|
||||
head = {
|
||||
{ cwd, hl = "UserTLHead" },
|
||||
{ "", hl = "UserTLHeadSep" },
|
||||
},
|
||||
active_tab = {
|
||||
label = function(tabid)
|
||||
return {
|
||||
" " .. tabid .. " ",
|
||||
hl = "UserTLActive",
|
||||
}
|
||||
end,
|
||||
left_sep = { "", hl = "UserTLActiveSep" },
|
||||
right_sep = { "", hl = "UserTLActiveSep" },
|
||||
},
|
||||
inactive_tab = {
|
||||
label = function(tabid)
|
||||
return {
|
||||
" " .. tabid .. " ",
|
||||
hl = "UserTLBoldLine",
|
||||
}
|
||||
end,
|
||||
left_sep = { "", hl = "UserTLLineSep" },
|
||||
right_sep = { "", hl = "UserTLLineSep" },
|
||||
},
|
||||
top_win = {
|
||||
label = function(winid)
|
||||
return {
|
||||
" " .. filename.unique(winid) .. " ",
|
||||
hl = "TabLine",
|
||||
}
|
||||
end,
|
||||
left_sep = { "", hl = "UserTLLineSep" },
|
||||
right_sep = { "", hl = "UserTLLineSep" },
|
||||
},
|
||||
win = {
|
||||
label = function(winid)
|
||||
return {
|
||||
" " .. filename.unique(winid) .. " ",
|
||||
hl = "TabLine",
|
||||
}
|
||||
end,
|
||||
left_sep = { "", hl = "UserTLLineSep" },
|
||||
right_sep = { "", hl = "UserTLLineSep" },
|
||||
},
|
||||
tail = {
|
||||
{ "", hl = "UserTLHeadSep" },
|
||||
{ " ", hl = "UserTLHead" },
|
||||
},
|
||||
}
|
||||
|
||||
require("tabby").setup({
|
||||
tabline = line,
|
||||
})
|
|
@ -6,18 +6,14 @@ local function nmap(shortcut, command)
|
|||
map('n', shortcut, command)
|
||||
end
|
||||
|
||||
local function imap(shortcut, command)
|
||||
map('i', shortcut, command)
|
||||
end
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
-- Misc
|
||||
imap('jk', '<Esc>')
|
||||
-- Aerial
|
||||
nmap('<leader>aa', '<cmd>AerialToggle<cr>')
|
||||
|
||||
-- Telescope
|
||||
nmap('<leader>;', '<cmd>Telescope builtin<cr>')
|
||||
nmap('<leader>ff', '<cmd>Telescope find_files<cr>')
|
||||
nmap('<leader>fg', '<cmd>Telescope live_grep<cr>')
|
||||
nmap('<leader>fp', '<cmd>Telescope projects<cr>')
|
||||
nmap('<leader>fa', '<cmd>Telescope aerial<cr>')
|
||||
nmap('<leader>fl', '<cmd>Telescope lsp_document_symbols<cr>')
|
||||
|
@ -34,3 +30,10 @@ nmap('<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<cr>')
|
|||
nmap('<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>')
|
||||
nmap('<leader>xq', '<cmd>TroubleToggle quickfix<cr>')
|
||||
nmap('<leader>xl', '<cmd>TroubleToggle loclist<cr>')
|
||||
|
||||
-- Navigator
|
||||
vim.keymap.set({'n', 't'}, '<A-h>', '<CMD>NavigatorLeft<CR>')
|
||||
vim.keymap.set({'n', 't'}, '<A-l>', '<CMD>NavigatorRight<CR>')
|
||||
vim.keymap.set({'n', 't'}, '<A-k>', '<CMD>NavigatorUp<CR>')
|
||||
vim.keymap.set({'n', 't'}, '<A-j>', '<CMD>NavigatorDown<CR>')
|
||||
vim.keymap.set({'n', 't'}, '<A-p>', '<CMD>NavigatorPrevious<CR>')
|
||||
|
|
|
@ -1,16 +1,3 @@
|
|||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
|
@ -24,17 +11,20 @@ require('packer').startup {
|
|||
use 'lewis6991/impatient.nvim'
|
||||
use 'stevearc/dressing.nvim'
|
||||
use {
|
||||
"navarasu/onedark.nvim",
|
||||
"EdenEast/nightfox.nvim",
|
||||
config = function ()
|
||||
require("onedark").setup {
|
||||
transparent = true,
|
||||
lualine = {
|
||||
transparent = true,
|
||||
},
|
||||
}
|
||||
require("onedark").load()
|
||||
require 'config.nightfox'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nanozuki/tabby.nvim',
|
||||
config = function ()
|
||||
require 'config.tabby'
|
||||
end
|
||||
}
|
||||
use {
|
||||
"navarasu/onedark.nvim",
|
||||
}
|
||||
use {
|
||||
'rcarriga/nvim-notify',
|
||||
config = function()
|
||||
|
@ -72,7 +62,7 @@ require('packer').startup {
|
|||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
config = function()
|
||||
require 'config_plugins.config_treesitter'
|
||||
require 'config.treesitter'
|
||||
end
|
||||
}
|
||||
use {
|
||||
|
@ -88,13 +78,13 @@ require('packer').startup {
|
|||
use {
|
||||
'j-hui/fidget.nvim',
|
||||
config = function()
|
||||
require('fidget').setup()
|
||||
require 'config.fidget'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'stevearc/aerial.nvim',
|
||||
config = function()
|
||||
require 'config_plugins.config_aerial'
|
||||
require 'config.aerial'
|
||||
end
|
||||
}
|
||||
use {
|
||||
|
@ -105,32 +95,35 @@ require('packer').startup {
|
|||
use {
|
||||
'https://github.com/lewis6991/gitsigns.nvim.git',
|
||||
config = function()
|
||||
require 'config_plugins.config_gitsigns'
|
||||
require 'config.gitsigns'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'feline-nvim/feline.nvim',
|
||||
config = function ()
|
||||
require 'config.feline'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = function()
|
||||
require 'config_plugins.config_lualine'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
config = function()
|
||||
require 'config_plugins.config_nvim-tree'
|
||||
require 'config.nvim-tree'
|
||||
end
|
||||
}
|
||||
use {
|
||||
"ahmedkhalf/project.nvim",
|
||||
config = function()
|
||||
require 'config_plugins.config_project'
|
||||
require 'config.project'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'akinsho/toggleterm.nvim',
|
||||
tag = 'v2.*',
|
||||
config = function()
|
||||
require 'config_plugins.config_toggleterm'
|
||||
require 'config.toggleterm'
|
||||
end
|
||||
}
|
||||
use {
|
||||
|
@ -144,13 +137,13 @@ require('packer').startup {
|
|||
{ 'nvim-lua/plenary.nvim' }
|
||||
},
|
||||
config = function()
|
||||
require 'config_plugins.config_telescope'
|
||||
require 'config.telescope'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'folke/trouble.nvim',
|
||||
config = function()
|
||||
require 'config_plugins.config_trouble'
|
||||
require 'config.trouble'
|
||||
end
|
||||
}
|
||||
use {
|
||||
|
@ -162,9 +155,12 @@ require('packer').startup {
|
|||
}
|
||||
end
|
||||
}
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
use {
|
||||
'numToStr/Navigator.nvim',
|
||||
config = function()
|
||||
require('Navigator').setup()
|
||||
end
|
||||
}
|
||||
end,
|
||||
config = {
|
||||
display = {
|
||||
|
@ -174,5 +170,5 @@ require('packer').startup {
|
|||
},
|
||||
}
|
||||
}
|
||||
require 'config_plugins.config_lsp'
|
||||
require 'config_plugins.config_cmp'
|
||||
require 'config.lsp'
|
||||
require 'config.cmp'
|
||||
|
|
|
@ -5,11 +5,6 @@ bind r source-file ~/.tmux.conf\; display "Reloaded conf."
|
|||
# Set color enabled
|
||||
set -g default-terminal "screen-256color"
|
||||
set -ga terminal-overrides ",*256col*,*kitty,alacritty:Tc"
|
||||
# set-option -sa terminal-overrides ',*256col*,alacritty:RGB' # TMUX > 3.2 only
|
||||
# Undercurl
|
||||
# set -g default-terminal "${TERM}"
|
||||
# set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
||||
# set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
|
||||
|
||||
# Set escape time to something sensible
|
||||
set-option -sg escape-time 10
|
||||
|
@ -17,38 +12,26 @@ set-option -sg escape-time 10
|
|||
# Enable focus events
|
||||
set-option -g focus-events on
|
||||
|
||||
|
||||
# Status bar styling
|
||||
set -g status-interval 60
|
||||
WEATHER='#(curl -s 'wttr.in/?format="%%C+%%t+%%p"')'
|
||||
set -g status-bg colour238
|
||||
set -g status-fg colour255
|
||||
set -g status-left "[#H] "
|
||||
set -g status-right "$WEATHER"
|
||||
|
||||
# set the pane border colors
|
||||
set -g pane-border-style 'fg=colour235,bg=colour238'
|
||||
set -g pane-active-border-style 'fg=colour75,bg=colour236'
|
||||
|
||||
|
||||
# Smart pane switching with awareness of Vim splits.
|
||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
||||
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
||||
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
||||
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
||||
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
||||
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
||||
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
||||
|
||||
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
||||
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
||||
bind-key -T copy-mode-vi 'C-\' select-pane -l
|
||||
|
||||
setw -g mode-keys vi
|
||||
#!/usr/bin/env bash
|
||||
# Nightfox colors for Tmux
|
||||
# Style: nightfox
|
||||
# Upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/nightfox/nightfox_tmux.tmux
|
||||
set -g mode-style "fg=#131a24,bg=#aeafb0"
|
||||
set -g message-style "fg=#131a24,bg=#aeafb0"
|
||||
set -g message-command-style "fg=#131a24,bg=#aeafb0"
|
||||
set -g pane-border-style "fg=#aeafb0"
|
||||
set -g pane-active-border-style "fg=#719cd6"
|
||||
set -g status "on"
|
||||
set -g status-justify "left"
|
||||
set -g status-style "fg=#aeafb0,bg=#131a24"
|
||||
set -g status-left-length "100"
|
||||
set -g status-right-length "100"
|
||||
set -g status-left-style NONE
|
||||
set -g status-right-style NONE
|
||||
set -g status-left "#[fg=#131a24,bg=#719cd6,bold] #S #[fg=#719cd6,bg=#131a24,nobold,nounderscore,noitalics]"
|
||||
set -g status-right "#[fg=#131a24,bg=#131a24,nobold,nounderscore,noitalics]#[fg=#719cd6,bg=#131a24] #{prefix_highlight} #[fg=#aeafb0,bg=#131a24,nobold,nounderscore,noitalics]#[fg=#131a24,bg=#aeafb0] %Y-%m-%d %I:%M %p #[fg=#719cd6,bg=#aeafb0,nobold,nounderscore,noitalics]#[fg=#131a24,bg=#719cd6,bold] #h "
|
||||
setw -g window-status-activity-style "underscore,fg=#71839b,bg=#131a24"
|
||||
setw -g window-status-separator ""
|
||||
setw -g window-status-style "NONE,fg=#71839b,bg=#131a24"
|
||||
setw -g window-status-format "#[fg=#131a24,bg=#131a24,nobold,nounderscore,noitalics]#[default] #I #W #F #[fg=#131a24,bg=#131a24,nobold,nounderscore,noitalics]"
|
||||
setw -g window-status-current-format "#[fg=#131a24,bg=#aeafb0,nobold,nounderscore,noitalics]#[fg=#131a24,bg=#aeafb0,bold] #I #W #F #[fg=#aeafb0,bg=#131a24,nobold,nounderscore,noitalics]"
|
||||
|
|
47
config/wezterm/wezterm.lua
Normal file
47
config/wezterm/wezterm.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
local wezterm = require('wezterm')
|
||||
local act = wezterm.action
|
||||
|
||||
local function isViProcess(pane)
|
||||
-- get_foreground_process_name On Linux, macOS and Windows,
|
||||
-- the process can be queried to determine this path. Other operating systems
|
||||
-- (notably, FreeBSD and other unix systems) are not currently supported
|
||||
return pane:get_foreground_process_name():find('n?vim') ~= nil
|
||||
-- return pane:get_title():find("n?vim") ~= nil
|
||||
end
|
||||
|
||||
local function conditionalActivatePane(window, pane, pane_direction, vim_direction)
|
||||
if isViProcess(pane) then
|
||||
window:perform_action(
|
||||
-- This should match the keybinds you set in Neovim.
|
||||
act.SendKey({ key = vim_direction, mods = 'ALT' }),
|
||||
pane
|
||||
)
|
||||
else
|
||||
window:perform_action(act.ActivatePaneDirection(pane_direction), pane)
|
||||
end
|
||||
end
|
||||
|
||||
wezterm.on('ActivatePaneDirection-right', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Right', 'l')
|
||||
end)
|
||||
wezterm.on('ActivatePaneDirection-left', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Left', 'h')
|
||||
end)
|
||||
wezterm.on('ActivatePaneDirection-up', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Up', 'k')
|
||||
end)
|
||||
wezterm.on('ActivatePaneDirection-down', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Down', 'j')
|
||||
end)
|
||||
|
||||
return {
|
||||
window_background_opacity = 0.95,
|
||||
color_scheme = "nightfox",
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
keys = {
|
||||
{ key = 'h', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-left') },
|
||||
{ key = 'j', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-down') },
|
||||
{ key = 'k', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-up') },
|
||||
{ key = 'l', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-right') },
|
||||
},
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
command -v fzf > /dev/null && exit 0
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git "$HOME/.fzf"
|
||||
"$HOME/.fzf/install"
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# kitty
|
||||
command -v kitty > /dev/null && exit 0
|
||||
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
|
||||
# Create a symbolic link to add kitty to PATH (assuming $HOME/.local/bin is in
|
||||
# your system-wide PATH)
|
||||
ln -s "$HOME/.local/kitty.app/bin/kitty" "$HOME/.local/bin/"
|
||||
# Place the kitty.desktop file somewhere it can be found by the OS
|
||||
cp "$HOME/.local/kitty.app/share/applications/kitty.desktop" "$HOME/.local/share/applications/"
|
||||
# If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file
|
||||
cp "$HOME/.local/kitty.app/share/applications/kitty-open.desktop" "$HOME/.local/share/applications/"
|
||||
# Update the paths to the kitty and its icon in the kitty.desktop file(s)
|
||||
sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" "$HOME/.local/share/applications/kitty.desktop"
|
||||
sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" "$HOME/.local/share/applications/kitty.desktop"
|
|
@ -1,9 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
FONT_DIR=$HOME/.local/share/fonts
|
||||
|
||||
mkdir -p $FONT_DIR
|
||||
for FONT in "$(dirname $(dirname $(readlink -f $0)))/nerdfont_symbols/*.ttf"
|
||||
do
|
||||
ln -s $FONT "$FONT_DIR/."
|
||||
done
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
command -v pipx > /dev/null || python3 -m pip install --user pipx
|
||||
command -v poetry > /dev/null || python3 -m pipx install poetry
|
||||
command -v pyright > /dev/null || python3 -m pipx install pyright
|
|
@ -1,11 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
command -v pyenv > /dev/null && exit 0
|
||||
curl https://pyenv.run | bash
|
||||
# Below are suggested dependencies for python
|
||||
# command -v apt > /dev/null && {
|
||||
# sudo apt update
|
||||
# sudo apt install build-essential libssl-dev zlib1g-dev \
|
||||
# libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
|
||||
# libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
|
||||
# }
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 最萌小汐
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
Binary file not shown.
|
@ -1,85 +0,0 @@
|
|||
local main, exec
|
||||
local i = 1
|
||||
while arg[i] do
|
||||
if arg[i] == '-E' then
|
||||
elseif arg[i] == '-e' then
|
||||
i = i + 1
|
||||
local expr = assert(arg[i], "'-e' needs argument")
|
||||
assert(load(expr, "=(command line)"))()
|
||||
-- exit after the executing
|
||||
exec = true
|
||||
elseif not main and arg[i]:sub(1, 1) ~= '-' then
|
||||
main = i
|
||||
elseif arg[i]:sub(1, 2) == '--' then
|
||||
break
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
if exec and not main then
|
||||
return
|
||||
end
|
||||
|
||||
if main then
|
||||
for i = -1, -999, -1 do
|
||||
if not arg[i] then
|
||||
for j = i + 1, -1 do
|
||||
arg[j - main + 1] = arg[j]
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
for j = 1, #arg do
|
||||
arg[j - main] = arg[j]
|
||||
end
|
||||
for j = #arg - main + 1, #arg do
|
||||
arg[j] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local root
|
||||
do
|
||||
if main then
|
||||
local fs = require 'bee.filesystem'
|
||||
local mainPath = fs.path(arg[0])
|
||||
root = mainPath:parent_path():string()
|
||||
if root == '' then
|
||||
root = '.'
|
||||
end
|
||||
else
|
||||
local sep = package.config:sub(1, 1)
|
||||
if sep == '\\' then
|
||||
sep = '/\\'
|
||||
end
|
||||
local pattern = "[" .. sep .. "]+[^" .. sep .. "]+"
|
||||
root = package.cpath:match("([^;]+)" .. pattern .. pattern .. "$")
|
||||
arg[0] = root .. package.config:sub(1, 1) .. 'main.lua'
|
||||
end
|
||||
root = root:gsub('[/\\]', package.config:sub(1, 1))
|
||||
end
|
||||
|
||||
package.path = table.concat({
|
||||
root .. "/script/?.lua",
|
||||
root .. "/script/?/init.lua",
|
||||
}, ";"):gsub('/', package.config:sub(1, 1))
|
||||
|
||||
package.searchers[2] = function (name)
|
||||
local filename, err = package.searchpath(name, package.path)
|
||||
if not filename then
|
||||
return err
|
||||
end
|
||||
local f = io.open(filename)
|
||||
if not f then
|
||||
return 'cannot open file:' .. filename
|
||||
end
|
||||
local buf = f:read '*a'
|
||||
f:close()
|
||||
local relative = filename:sub(1, #root) == root and filename:sub(#root + 2) or filename
|
||||
local init, err = load(buf, '@' .. relative)
|
||||
if not init then
|
||||
return err
|
||||
end
|
||||
return init, filename
|
||||
end
|
||||
|
||||
assert(loadfile(arg[0]))(table.unpack(arg))
|
1690
lua-lsp/changelog.md
1690
lua-lsp/changelog.md
File diff suppressed because it is too large
Load diff
|
@ -1,66 +0,0 @@
|
|||
if not DEVELOP then
|
||||
return
|
||||
end
|
||||
|
||||
local fs = require 'bee.filesystem'
|
||||
local luaDebugs = {}
|
||||
|
||||
local home = os.getenv 'USERPROFILE' or os.getenv 'HOME'
|
||||
if not home then
|
||||
log.error('Cannot find home directory')
|
||||
return
|
||||
end
|
||||
for _, vscodePath in ipairs { '.vscode', '.vscode-insiders', '.vscode-server-insiders' } do
|
||||
local extensionPath = fs.path(home) / vscodePath / 'extensions'
|
||||
log.debug('Search extensions at:', extensionPath:string())
|
||||
|
||||
if fs.exists(extensionPath) then
|
||||
for path in fs.pairs(extensionPath) do
|
||||
if fs.is_directory(path) then
|
||||
local name = path:filename():string()
|
||||
if name:find('actboy168.lua-debug-', 1, true) then
|
||||
luaDebugs[#luaDebugs+1] = path:string()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #luaDebugs == 0 then
|
||||
log.debug('Cant find "actboy168.lua-debug"')
|
||||
return
|
||||
end
|
||||
|
||||
local function getVer(filename)
|
||||
local a, b, c = filename:match('actboy168%.lua%-debug%-(%d+)%.(%d+)%.(%d+)')
|
||||
if not a then
|
||||
return 0
|
||||
end
|
||||
return a * 1000000 + b * 1000 + c
|
||||
end
|
||||
|
||||
table.sort(luaDebugs, function (a, b)
|
||||
return getVer(a) > getVer(b)
|
||||
end)
|
||||
|
||||
local debugPath = luaDebugs[1]
|
||||
local cpath = "/runtime/win64/lua54/?.dll;/runtime/win64/lua54/?.so"
|
||||
local path = "/script/?.lua"
|
||||
|
||||
local function tryDebugger()
|
||||
local entry = assert(package.searchpath('debugger', debugPath .. path))
|
||||
local root = debugPath
|
||||
local addr = ("127.0.0.1:%d"):format(DBGPORT)
|
||||
local dbg = loadfile(entry)(root)
|
||||
dbg:start {
|
||||
address = addr,
|
||||
}
|
||||
log.debug('Debugger startup, listen port:', DBGPORT)
|
||||
log.debug('Debugger args:', addr, root, path, cpath)
|
||||
if DBGWAIT then
|
||||
dbg:event('wait')
|
||||
end
|
||||
return dbg
|
||||
end
|
||||
|
||||
xpcall(tryDebugger, log.debug)
|
|
@ -1,764 +0,0 @@
|
|||
---@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 key–value 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 key–value 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 =
|
||||
'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 =
|
||||
'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 =
|
||||
'If the value `x` is convertible to an integer, returns that integer.'
|
||||
math.type =
|
||||
'Returns `"integer"` if `x` is an integer, `"float"` if it is a float, or `nil` if `x` is not a number.'
|
||||
math.ult =
|
||||
'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, 1–7, Sunday is 1'
|
||||
osdate.yday =
|
||||
'day of the year, 1–366'
|
||||
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 =
|
||||
'Looks for the first match of `pattern` (see §6.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 =
|
||||
[[
|
||||
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.gsub =
|
||||
'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.len =
|
||||
'Returns its length.'
|
||||
string.lower =
|
||||
'Returns a copy of this string with all uppercase letters changed to lowercase.'
|
||||
string.match =
|
||||
'Looks for the first match of `pattern` (see §6.4.1) in the string.'
|
||||
string.pack =
|
||||
'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 =
|
||||
'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.'
|
File diff suppressed because it is too large
Load diff
|
@ -1,411 +0,0 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
|
||||
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://github.com/sumneko/lua-language-server/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.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/sumneko/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.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.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.telemetry.enable =
|
||||
[[
|
||||
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Home#privacy).
|
||||
]]
|
||||
config.misc.parameters =
|
||||
'[Command line parameters](https://github.com/sumneko/lua-telemetry-server/tree/master/method) when starting the language server in VSCode.'
|
||||
config.misc.executablePath =
|
||||
'Specify the executable path in VSCode.'
|
||||
config.IntelliSense.traceLocalSet =
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
config.IntelliSense.traceReturn =
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
config.IntelliSense.traceBeSetted =
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
config.IntelliSense.traceFieldInject =
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
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.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.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. 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'] =
|
||||
'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['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['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['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.'
|
|
@ -1,764 +0,0 @@
|
|||
---@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 =
|
||||
'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 =
|
||||
'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 =
|
||||
'Se o valor `x` pode ser convertido para um inteiro, retorna esse inteiro.'
|
||||
math.type =
|
||||
'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 =
|
||||
'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, 1–7, Domingo é 1'
|
||||
osdate.yday =
|
||||
'Dia do ano, 1–366'
|
||||
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`).'
|
File diff suppressed because it is too large
Load diff
|
@ -1,411 +0,0 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
|
||||
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://github.com/sumneko/lua-language-server/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.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/sumneko/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.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.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.telemetry.enable = -- TODO: need translate!
|
||||
[[
|
||||
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Home#privacy).
|
||||
]]
|
||||
config.misc.parameters = -- TODO: need translate!
|
||||
'[Command line parameters](https://github.com/sumneko/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.IntelliSense.traceLocalSet = -- TODO: need translate!
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
config.IntelliSense.traceReturn = -- TODO: need translate!
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
config.IntelliSense.traceBeSetted = -- TODO: need translate!
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
config.IntelliSense.traceFieldInject = -- TODO: need translate!
|
||||
'Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) to learn more.'
|
||||
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.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.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['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['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['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.'
|
|
@ -1,742 +0,0 @@
|
|||
---@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 =
|
||||
'最大值的整数。'
|
||||
math.min =
|
||||
'返回参数中最小的值, 大小由 Lua 操作 `<` 决定。'
|
||||
math.mininteger =
|
||||
'最小值的整数。'
|
||||
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 =
|
||||
'如果 `x` 可以转换为一个整数, 返回该整数。'
|
||||
math.type =
|
||||
'如果 `x` 是整数,返回 `"integer"`, 如果它是浮点数,返回 `"float"`, 如果 `x` 不是数字,返回 `nil`。'
|
||||
math.ult =
|
||||
'如果整数 `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 = -- 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 =
|
||||
'接收零或多个整数, 将每个整数转换成对应的 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` 处开始统计)。'
|
File diff suppressed because it is too large
Load diff
|
@ -1,410 +0,0 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
|
||||
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://github.com/sumneko/lua-language-server/wiki/Plugins)了解用法。"
|
||||
config.runtime.pluginArgs = -- TODO: need translate!
|
||||
"Additional arguments for the plugin."
|
||||
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.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/sumneko/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.semicolon =
|
||||
'若语句尾部没有分号,则显示虚拟分号。'
|
||||
config.hint.semicolon.All =
|
||||
'所有语句都显示虚拟分号。'
|
||||
config.hint.semicolon.SameLine =
|
||||
'2个语句在同一行时,在它们之间显示分号。'
|
||||
config.hint.semicolon.Disable =
|
||||
'禁用虚拟分号。'
|
||||
config.format.enable =
|
||||
'启用代码格式化程序。'
|
||||
config.format.defaultConfig =
|
||||
[[
|
||||
默认的格式化配置,优先级低于工作区内的 `.editorconfig` 文件。
|
||||
请查阅[格式化文档](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)了解用法。
|
||||
]]
|
||||
config.spell.dict =
|
||||
'拼写检查的自定义单词。'
|
||||
config.telemetry.enable =
|
||||
[[
|
||||
启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://github.com/sumneko/lua-language-server/wiki/Home#privacy)阅读我们的隐私声明。
|
||||
]]
|
||||
config.misc.parameters =
|
||||
'VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#arguments)。'
|
||||
config.misc.executablePath =
|
||||
'VSCode中指定可执行文件路径。'
|
||||
config.IntelliSense.traceLocalSet =
|
||||
'请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。'
|
||||
config.IntelliSense.traceReturn =
|
||||
'请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。'
|
||||
config.IntelliSense.traceBeSetted =
|
||||
'请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。'
|
||||
config.IntelliSense.traceFieldInject =
|
||||
'请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)了解用法。'
|
||||
config.type.castNumberToInteger =
|
||||
'允许将 `number` 类型赋给 `integer` 类型。'
|
||||
config.type.weakUnionCheck =
|
||||
[[
|
||||
联合类型中只要有一个子类型满足条件,则联合类型也满足条件。
|
||||
|
||||
此设置为 `false` 时,`number|boolean` 类型无法赋给 `number` 类型;为 `true` 时则可以。
|
||||
]]
|
||||
config.type.weakNilCheck =
|
||||
[[
|
||||
对联合类型进行类型检查时,忽略其中的 `nil`。
|
||||
|
||||
此设置为 `false` 时,`numer|nil` 类型无法赋给 `number` 类型;为 `true` 是则可以。
|
||||
]]
|
||||
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.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'] = -- 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['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['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['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.'
|
|
@ -1,743 +0,0 @@
|
|||
---@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 =
|
||||
[[
|
||||
為指定的表設定中繼資料表。(你不能在 Lua 中改變其它類型值的中繼資料表,那些只能在 C 裡做。)如果 `metatable` 是 `nil`,將指定的表的中繼資料表移除。如果原來那張中繼資料表有 `"__metatable"` 域,擲回一個錯誤。
|
||||
]]
|
||||
|
||||
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 =
|
||||
'最大值的整數。'
|
||||
math.min =
|
||||
'回傳引數中最小的值,大小由 Lua 運算子 `<` 決定。'
|
||||
math.mininteger =
|
||||
'最小值的整數。'
|
||||
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 =
|
||||
'如果 `x` 可以轉換為一個整數,回傳該整數。'
|
||||
math.type =
|
||||
'如果 `x` 是整數,回傳 `"integer"` ,如果它是浮點數,回傳 `"float"` ,如果 `x` 不是數字,回傳 `nil` 。'
|
||||
math.ult =
|
||||
'整數 `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` 處開始統計)。'
|
File diff suppressed because it is too large
Load diff
|
@ -1,410 +0,0 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
|
||||
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://github.com/sumneko/lua-language-server/wiki/Plugins)瞭解用法。"
|
||||
config.runtime.pluginArgs = -- TODO: need translate!
|
||||
"Additional arguments for the plugin."
|
||||
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.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 = -- 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 =
|
||||
"進行工作區診斷的延遲(毫秒)。"
|
||||
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 = -- TODO: need translate!
|
||||
'Do not diagnose `unused-local` when the variable name matches the following pattern.'
|
||||
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/sumneko/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.semicolon =
|
||||
'若陳述式尾部沒有分號,則顯示虛擬分號。'
|
||||
config.hint.semicolon.All =
|
||||
'所有陳述式都顯示虛擬分號。'
|
||||
config.hint.semicolon.SameLine =
|
||||
'兩個陳述式在同一行時,在它們之間顯示分號。'
|
||||
config.hint.semicolon.Disable =
|
||||
'停用虛擬分號。'
|
||||
config.format.enable =
|
||||
'啟用程式碼格式化程式。'
|
||||
config.format.defaultConfig =
|
||||
[[
|
||||
預設的格式化組態,優先順序低於工作區內的 `.editorconfig` 檔案。
|
||||
請查閱[格式化文件](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)了解用法。
|
||||
]]
|
||||
config.spell.dict =
|
||||
'拼寫檢查的自訂單詞。'
|
||||
config.telemetry.enable =
|
||||
[[
|
||||
啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://github.com/sumneko/lua-language-server/wiki/Home#privacy)閱讀我們的隱私聲明。
|
||||
]]
|
||||
config.misc.parameters =
|
||||
'VSCode中啟動語言伺服時的[命令列參數](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#arguments)。'
|
||||
config.misc.executablePath = -- TODO: need translate!
|
||||
'Specify the executable path in VSCode.'
|
||||
config.IntelliSense.traceLocalSet =
|
||||
'請查閱[文件](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。'
|
||||
config.IntelliSense.traceReturn =
|
||||
'請查閱[文件](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。'
|
||||
config.IntelliSense.traceBeSetted =
|
||||
'請查閱[文件](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。'
|
||||
config.IntelliSense.traceFieldInject =
|
||||
'請查閱[文件](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features)瞭解用法。'
|
||||
config.type.castNumberToInteger =
|
||||
'允許將 `number` 類型賦值給 `integer` 類型。'
|
||||
config.type.weakUnionCheck =
|
||||
[[
|
||||
同位類型中只要有一個子類型滿足條件,則同位類型也滿足條件。
|
||||
|
||||
此設定為 `false` 時,`number|boolean` 類型無法賦給 `number` 類型;為 `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.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.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'] = -- 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['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['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['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.'
|
|
@ -1,79 +0,0 @@
|
|||
local fs = require 'bee.filesystem'
|
||||
local util = require 'utility'
|
||||
local version = require 'version'
|
||||
|
||||
local function getValue(value)
|
||||
if value == 'true' or value == nil then
|
||||
value = true
|
||||
elseif value == 'false' then
|
||||
value = false
|
||||
elseif tonumber(value) then
|
||||
value = tonumber(value)
|
||||
elseif value:sub(1, 1) == '"' and value:sub(-1, -1) == '"' then
|
||||
value = value:sub(2, -2)
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
local function loadArgs()
|
||||
---@type string?
|
||||
local lastKey
|
||||
for _, v in ipairs(arg) do
|
||||
---@type string?
|
||||
local key, tail = v:match '^%-%-([%w_]+)(.*)$'
|
||||
local value
|
||||
if key then
|
||||
value = tail:match '=(.+)'
|
||||
lastKey = nil
|
||||
if not value then
|
||||
lastKey = key
|
||||
end
|
||||
else
|
||||
if lastKey then
|
||||
key = lastKey
|
||||
value = v
|
||||
lastKey = nil
|
||||
end
|
||||
end
|
||||
if key then
|
||||
_G[key:upper()] = getValue(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
loadArgs()
|
||||
|
||||
local currentPath = debug.getinfo(1, 'S').source:sub(2)
|
||||
local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '')
|
||||
|
||||
rootPath = (rootPath == '' and '.' or rootPath)
|
||||
ROOT = fs.path(util.expandPath(rootPath))
|
||||
LOGPATH = LOGPATH and util.expandPath(LOGPATH) or (ROOT:string() .. '/log')
|
||||
METAPATH = METAPATH and util.expandPath(METAPATH) or (ROOT:string() .. '/meta')
|
||||
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
debug.setcstacklimit(200)
|
||||
collectgarbage('generational', 10, 50)
|
||||
--collectgarbage('incremental', 120, 120, 0)
|
||||
|
||||
---@diagnostic disable-next-line: lowercase-global
|
||||
log = require 'log'
|
||||
log.init(ROOT, fs.path(LOGPATH) / 'service.log')
|
||||
if LOGLEVEL then
|
||||
log.level = tostring(LOGLEVEL):lower()
|
||||
end
|
||||
|
||||
log.info('Lua Lsp startup, root: ', ROOT)
|
||||
log.info('ROOT:', ROOT:string())
|
||||
log.info('LOGPATH:', LOGPATH)
|
||||
log.info('METAPATH:', METAPATH)
|
||||
log.info('VERSION:', version.getVersion())
|
||||
|
||||
require 'tracy'
|
||||
require 'cli'
|
||||
|
||||
xpcall(dofile, log.debug, (ROOT / 'debugger.lua'):string())
|
||||
|
||||
local _, service = xpcall(require, log.error, 'service')
|
||||
|
||||
service.start()
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"name": "Cocos",
|
||||
"files": ["cocos"],
|
||||
"settings": {
|
||||
"Lua.runtime.version": "LuaJIT"
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Action :cc.Ref
|
||||
local Action={ }
|
||||
cc.Action=Action
|
||||
|
||||
|
||||
|
||||
|
||||
---* Called before the action start. It will also set the target. <br>
|
||||
---* param target A certain target.
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function Action:startWithTarget (target) end
|
||||
---* Set the original target, since target can be nil.<br>
|
||||
---* Is the target that were used to run the action. Unless you are doing something complex, like ActionManager, you should NOT call this method.<br>
|
||||
---* The target is 'assigned', it is not 'retained'.<br>
|
||||
---* since v0.8.2<br>
|
||||
---* param originalTarget Is 'assigned', it is not 'retained'.
|
||||
---@param originalTarget cc.Node
|
||||
---@return self
|
||||
function Action:setOriginalTarget (originalTarget) end
|
||||
---* Returns a clone of action.<br>
|
||||
---* return A clone action.
|
||||
---@return self
|
||||
function Action:clone () end
|
||||
---* Return a original Target. <br>
|
||||
---* return A original Target.
|
||||
---@return cc.Node
|
||||
function Action:getOriginalTarget () end
|
||||
---* Called after the action has finished. It will set the 'target' to nil.<br>
|
||||
---* IMPORTANT: You should never call "Action::stop()" manually. Instead, use: "target->stopAction(action);".
|
||||
---@return self
|
||||
function Action:stop () end
|
||||
---* Called once per frame. time a value between 0 and 1.<br>
|
||||
---* For example:<br>
|
||||
---* - 0 Means that the action just started.<br>
|
||||
---* - 0.5 Means that the action is in the middle.<br>
|
||||
---* - 1 Means that the action is over.<br>
|
||||
---* param time A value between 0 and 1.
|
||||
---@param time float
|
||||
---@return self
|
||||
function Action:update (time) end
|
||||
---* Return certain target.<br>
|
||||
---* return A certain target.
|
||||
---@return cc.Node
|
||||
function Action:getTarget () end
|
||||
---* Returns a flag field that is used to group the actions easily.<br>
|
||||
---* return A tag.
|
||||
---@return unsigned_int
|
||||
function Action:getFlags () end
|
||||
---* Called every frame with it's delta time, dt in seconds. DON'T override unless you know what you are doing. <br>
|
||||
---* param dt In seconds.
|
||||
---@param dt float
|
||||
---@return self
|
||||
function Action:step (dt) end
|
||||
---* Changes the tag that is used to identify the action easily. <br>
|
||||
---* param tag Used to identify the action easily.
|
||||
---@param tag int
|
||||
---@return self
|
||||
function Action:setTag (tag) end
|
||||
---* Changes the flag field that is used to group the actions easily.<br>
|
||||
---* param flags Used to group the actions easily.
|
||||
---@param flags unsigned_int
|
||||
---@return self
|
||||
function Action:setFlags (flags) end
|
||||
---* Returns a tag that is used to identify the action easily. <br>
|
||||
---* return A tag.
|
||||
---@return int
|
||||
function Action:getTag () end
|
||||
---* The action will modify the target properties. <br>
|
||||
---* param target A certain target.
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function Action:setTarget (target) end
|
||||
---* Return true if the action has finished. <br>
|
||||
---* return Is true if the action has finished.
|
||||
---@return boolean
|
||||
function Action:isDone () end
|
||||
---* Returns a new action that performs the exact reverse of the action. <br>
|
||||
---* return A new action that performs the exact reverse of the action.<br>
|
||||
---* js NA
|
||||
---@return self
|
||||
function Action:reverse () end
|
|
@ -1,47 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionCamera :cc.ActionInterval
|
||||
local ActionCamera={ }
|
||||
cc.ActionCamera=ActionCamera
|
||||
|
||||
|
||||
|
||||
|
||||
---@overload fun(float:float,float:float,float:float):self
|
||||
---@overload fun(float0:vec3_table):self
|
||||
---@param x float
|
||||
---@param y float
|
||||
---@param z float
|
||||
---@return self
|
||||
function ActionCamera:setEye (x,y,z) end
|
||||
---*
|
||||
---@return vec3_table
|
||||
function ActionCamera:getEye () end
|
||||
---*
|
||||
---@param up vec3_table
|
||||
---@return self
|
||||
function ActionCamera:setUp (up) end
|
||||
---*
|
||||
---@return vec3_table
|
||||
function ActionCamera:getCenter () end
|
||||
---*
|
||||
---@param center vec3_table
|
||||
---@return self
|
||||
function ActionCamera:setCenter (center) end
|
||||
---*
|
||||
---@return vec3_table
|
||||
function ActionCamera:getUp () end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionCamera:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionCamera:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function ActionCamera:reverse () end
|
||||
---* js ctor<br>
|
||||
---* lua new
|
||||
---@return self
|
||||
function ActionCamera:ActionCamera () end
|
|
@ -1,29 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionEase :cc.ActionInterval
|
||||
local ActionEase={ }
|
||||
cc.ActionEase=ActionEase
|
||||
|
||||
|
||||
|
||||
|
||||
---* brief Initializes the action.<br>
|
||||
---* return Return true when the initialization success, otherwise return false.
|
||||
---@param action cc.ActionInterval
|
||||
---@return boolean
|
||||
function ActionEase:initWithAction (action) end
|
||||
---* brief Get the pointer of the inner action.<br>
|
||||
---* return The pointer of the inner action.
|
||||
---@return cc.ActionInterval
|
||||
function ActionEase:getInnerAction () end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionEase:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionEase:stop () end
|
||||
---*
|
||||
---@param time float
|
||||
---@return self
|
||||
function ActionEase:update (time) end
|
|
@ -1,46 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionFloat :cc.ActionInterval
|
||||
local ActionFloat={ }
|
||||
cc.ActionFloat=ActionFloat
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param duration float
|
||||
---@param from float
|
||||
---@param to float
|
||||
---@param callback function
|
||||
---@return boolean
|
||||
function ActionFloat:initWithDuration (duration,from,to,callback) end
|
||||
---* Creates FloatAction with specified duration, from value, to value and callback to report back<br>
|
||||
---* results<br>
|
||||
---* param duration of the action<br>
|
||||
---* param from value to start from<br>
|
||||
---* param to value to be at the end of the action<br>
|
||||
---* param callback to report back result<br>
|
||||
---* return An autoreleased ActionFloat object
|
||||
---@param duration float
|
||||
---@param from float
|
||||
---@param to float
|
||||
---@param callback function
|
||||
---@return self
|
||||
function ActionFloat:create (duration,from,to,callback) end
|
||||
---* Overridden ActionInterval methods
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionFloat:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionFloat:clone () end
|
||||
---*
|
||||
---@param delta float
|
||||
---@return self
|
||||
function ActionFloat:update (delta) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionFloat:reverse () end
|
||||
---*
|
||||
---@return self
|
||||
function ActionFloat:ActionFloat () end
|
|
@ -1,30 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionInstant :cc.FiniteTimeAction
|
||||
local ActionInstant={ }
|
||||
cc.ActionInstant=ActionInstant
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionInstant:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionInstant:reverse () end
|
||||
---*
|
||||
---@return self
|
||||
function ActionInstant:clone () end
|
||||
---* param time In seconds.
|
||||
---@param time float
|
||||
---@return self
|
||||
function ActionInstant:update (time) end
|
||||
---* param dt In seconds.
|
||||
---@param dt float
|
||||
---@return self
|
||||
function ActionInstant:step (dt) end
|
||||
---*
|
||||
---@return boolean
|
||||
function ActionInstant:isDone () end
|
|
@ -1,43 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionInterval :cc.FiniteTimeAction
|
||||
local ActionInterval={ }
|
||||
cc.ActionInterval=ActionInterval
|
||||
|
||||
|
||||
|
||||
|
||||
---* Gets the amplitude rate, extension in GridAction<br>
|
||||
---* return The amplitude rate.
|
||||
---@return float
|
||||
function ActionInterval:getAmplitudeRate () end
|
||||
---* initializes the action
|
||||
---@param d float
|
||||
---@return boolean
|
||||
function ActionInterval:initWithDuration (d) end
|
||||
---* Sets the amplitude rate, extension in GridAction<br>
|
||||
---* param amp The amplitude rate.
|
||||
---@param amp float
|
||||
---@return self
|
||||
function ActionInterval:setAmplitudeRate (amp) end
|
||||
---* How many seconds had elapsed since the actions started to run.<br>
|
||||
---* return The seconds had elapsed since the actions started to run.
|
||||
---@return float
|
||||
function ActionInterval:getElapsed () end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionInterval:startWithTarget (target) end
|
||||
---* param dt in seconds
|
||||
---@param dt float
|
||||
---@return self
|
||||
function ActionInterval:step (dt) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionInterval:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function ActionInterval:reverse () end
|
||||
---*
|
||||
---@return boolean
|
||||
function ActionInterval:isDone () end
|
|
@ -1,124 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionManager :cc.Ref
|
||||
local ActionManager={ }
|
||||
cc.ActionManager=ActionManager
|
||||
|
||||
|
||||
|
||||
|
||||
---* Gets an action given its tag an a target.<br>
|
||||
---* param tag The action's tag.<br>
|
||||
---* param target A certain target.<br>
|
||||
---* return The Action the with the given tag.
|
||||
---@param tag int
|
||||
---@param target cc.Node
|
||||
---@return cc.Action
|
||||
function ActionManager:getActionByTag (tag,target) end
|
||||
---* Removes an action given its tag and the target.<br>
|
||||
---* param tag The action's tag.<br>
|
||||
---* param target A certain target.
|
||||
---@param tag int
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionManager:removeActionByTag (tag,target) end
|
||||
---* Removes all actions matching at least one bit in flags and the target.<br>
|
||||
---* param flags The flag field to match the actions' flags based on bitwise AND.<br>
|
||||
---* param target A certain target.<br>
|
||||
---* js NA
|
||||
---@param flags unsigned_int
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionManager:removeActionsByFlags (flags,target) end
|
||||
---* Removes all actions from all the targets.
|
||||
---@return self
|
||||
function ActionManager:removeAllActions () end
|
||||
---* Adds an action with a target. <br>
|
||||
---* If the target is already present, then the action will be added to the existing target.<br>
|
||||
---* If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target.<br>
|
||||
---* When the target is paused, the queued actions won't be 'ticked'.<br>
|
||||
---* param action A certain action.<br>
|
||||
---* param target The target which need to be added an action.<br>
|
||||
---* param paused Is the target paused or not.
|
||||
---@param action cc.Action
|
||||
---@param target cc.Node
|
||||
---@param paused boolean
|
||||
---@return self
|
||||
function ActionManager:addAction (action,target,paused) end
|
||||
---* Resumes the target. All queued actions will be resumed.<br>
|
||||
---* param target A certain target.
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionManager:resumeTarget (target) end
|
||||
---* Returns the numbers of actions that are running in all targets.<br>
|
||||
---* return The numbers of actions that are running in all target.<br>
|
||||
---* js NA
|
||||
---@return int
|
||||
function ActionManager:getNumberOfRunningActions () end
|
||||
---* Pauses the target: all running actions and newly added actions will be paused.<br>
|
||||
---* param target A certain target.
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionManager:pauseTarget (target) end
|
||||
---* Returns the numbers of actions that are running in a certain target. <br>
|
||||
---* Composable actions are counted as 1 action. Example:<br>
|
||||
---* - If you are running 1 Sequence of 7 actions, it will return 1.<br>
|
||||
---* - If you are running 7 Sequences of 2 actions, it will return 7.<br>
|
||||
---* param target A certain target.<br>
|
||||
---* return The numbers of actions that are running in a certain target.<br>
|
||||
---* js NA
|
||||
---@param target cc.Node
|
||||
---@return int
|
||||
function ActionManager:getNumberOfRunningActionsInTarget (target) end
|
||||
---* Removes all actions from a certain target.<br>
|
||||
---* All the actions that belongs to the target will be removed.<br>
|
||||
---* param target A certain target.
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionManager:removeAllActionsFromTarget (target) end
|
||||
---* Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).<br>
|
||||
---* param targetsToResume A set of targets need to be resumed.
|
||||
---@param targetsToResume array_table
|
||||
---@return self
|
||||
function ActionManager:resumeTargets (targetsToResume) end
|
||||
---* Removes an action given an action reference.<br>
|
||||
---* param action A certain target.
|
||||
---@param action cc.Action
|
||||
---@return self
|
||||
function ActionManager:removeAction (action) end
|
||||
---* Pauses all running actions, returning a list of targets whose actions were paused.<br>
|
||||
---* return A list of targets whose actions were paused.
|
||||
---@return array_table
|
||||
function ActionManager:pauseAllRunningActions () end
|
||||
---* Main loop of ActionManager.<br>
|
||||
---* param dt In seconds.
|
||||
---@param dt float
|
||||
---@return self
|
||||
function ActionManager:update (dt) end
|
||||
---* Removes all actions given its tag and the target.<br>
|
||||
---* param tag The actions' tag.<br>
|
||||
---* param target A certain target.<br>
|
||||
---* js NA
|
||||
---@param tag int
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionManager:removeAllActionsByTag (tag,target) end
|
||||
---* Returns the numbers of actions that are running in a<br>
|
||||
---* certain target with a specific tag.<br>
|
||||
---* Like getNumberOfRunningActionsInTarget Composable actions<br>
|
||||
---* are counted as 1 action. Example:<br>
|
||||
---* - If you are running 1 Sequence of 7 actions, it will return 1.<br>
|
||||
---* - If you are running 7 Sequences of 2 actions, it will return 7.<br>
|
||||
---* param target A certain target.<br>
|
||||
---* param tag Tag that will be searched.<br>
|
||||
---* return The numbers of actions that are running in a certain target<br>
|
||||
---* with a specific tag.<br>
|
||||
---* see getNumberOfRunningActionsInTarget<br>
|
||||
---* js NA
|
||||
---@param target cc.Node
|
||||
---@param tag int
|
||||
---@return unsigned_int
|
||||
function ActionManager:getNumberOfRunningActionsInTargetByTag (target,tag) end
|
||||
---* js ctor
|
||||
---@return self
|
||||
function ActionManager:ActionManager () end
|
|
@ -1,47 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ActionTween :cc.ActionInterval
|
||||
local ActionTween={ }
|
||||
cc.ActionTween=ActionTween
|
||||
|
||||
|
||||
|
||||
|
||||
---* brief Initializes the action with the property name (key), and the from and to parameters.<br>
|
||||
---* param duration The duration of the ActionTween. It's a value in seconds.<br>
|
||||
---* param key The key of property which should be updated.<br>
|
||||
---* param from The value of the specified property when the action begin.<br>
|
||||
---* param to The value of the specified property when the action end.<br>
|
||||
---* return If the initialization success, return true; otherwise, return false.
|
||||
---@param duration float
|
||||
---@param key string
|
||||
---@param from float
|
||||
---@param to float
|
||||
---@return boolean
|
||||
function ActionTween:initWithDuration (duration,key,from,to) end
|
||||
---* brief Create and initializes the action with the property name (key), and the from and to parameters.<br>
|
||||
---* param duration The duration of the ActionTween. It's a value in seconds.<br>
|
||||
---* param key The key of property which should be updated.<br>
|
||||
---* param from The value of the specified property when the action begin.<br>
|
||||
---* param to The value of the specified property when the action end.<br>
|
||||
---* return If the creation success, return a pointer of ActionTween; otherwise, return nil.
|
||||
---@param duration float
|
||||
---@param key string
|
||||
---@param from float
|
||||
---@param to float
|
||||
---@return self
|
||||
function ActionTween:create (duration,key,from,to) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function ActionTween:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionTween:clone () end
|
||||
---*
|
||||
---@param dt float
|
||||
---@return self
|
||||
function ActionTween:update (dt) end
|
||||
---*
|
||||
---@return self
|
||||
function ActionTween:reverse () end
|
|
@ -1,21 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AmbientLight :cc.BaseLight
|
||||
local AmbientLight={ }
|
||||
cc.AmbientLight=AmbientLight
|
||||
|
||||
|
||||
|
||||
|
||||
---* Creates a ambient light.<br>
|
||||
---* param color The light's color.<br>
|
||||
---* return The new ambient light.
|
||||
---@param color color3b_table
|
||||
---@return self
|
||||
function AmbientLight:create (color) end
|
||||
---*
|
||||
---@return int
|
||||
function AmbientLight:getLightType () end
|
||||
---*
|
||||
---@return self
|
||||
function AmbientLight:AmbientLight () end
|
|
@ -1,52 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Animate :cc.ActionInterval
|
||||
local Animate={ }
|
||||
cc.Animate=Animate
|
||||
|
||||
|
||||
|
||||
|
||||
---* initializes the action with an Animation and will restore the original frame when the animation is over
|
||||
---@param animation cc.Animation
|
||||
---@return boolean
|
||||
function Animate:initWithAnimation (animation) end
|
||||
---@overload fun():self
|
||||
---@overload fun():self
|
||||
---@return cc.Animation
|
||||
function Animate:getAnimation () end
|
||||
---* Gets the index of sprite frame currently displayed.<br>
|
||||
---* return int the index of sprite frame currently displayed.
|
||||
---@return int
|
||||
function Animate:getCurrentFrameIndex () end
|
||||
---* Sets the Animation object to be animated <br>
|
||||
---* param animation certain animation.
|
||||
---@param animation cc.Animation
|
||||
---@return self
|
||||
function Animate:setAnimation (animation) end
|
||||
---* Creates the action with an Animation and will restore the original frame when the animation is over.<br>
|
||||
---* param animation A certain animation.<br>
|
||||
---* return An autoreleased Animate object.
|
||||
---@param animation cc.Animation
|
||||
---@return self
|
||||
function Animate:create (animation) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function Animate:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function Animate:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function Animate:stop () end
|
||||
---*
|
||||
---@return self
|
||||
function Animate:reverse () end
|
||||
---* param t In seconds.
|
||||
---@param t float
|
||||
---@return self
|
||||
function Animate:update (t) end
|
||||
---*
|
||||
---@return self
|
||||
function Animate:Animate () end
|
|
@ -1,109 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Animate3D :cc.ActionInterval
|
||||
local Animate3D={ }
|
||||
cc.Animate3D=Animate3D
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param keyFrame int
|
||||
---@param userInfo map_table
|
||||
---@return self
|
||||
function Animate3D:setKeyFrameUserInfo (keyFrame,userInfo) end
|
||||
---* get & set speed, negative speed means playing reverse
|
||||
---@return float
|
||||
function Animate3D:getSpeed () end
|
||||
---* set animate quality
|
||||
---@param quality int
|
||||
---@return self
|
||||
function Animate3D:setQuality (quality) end
|
||||
---*
|
||||
---@param weight float
|
||||
---@return self
|
||||
function Animate3D:setWeight (weight) end
|
||||
---*
|
||||
---@return self
|
||||
function Animate3D:removeFromMap () end
|
||||
---*
|
||||
---@param animation cc.Animation3D
|
||||
---@param startFrame int
|
||||
---@param endFrame int
|
||||
---@param frameRate float
|
||||
---@return boolean
|
||||
function Animate3D:initWithFrames (animation,startFrame,endFrame,frameRate) end
|
||||
---*
|
||||
---@return float
|
||||
function Animate3D:getOriginInterval () end
|
||||
---*
|
||||
---@param speed float
|
||||
---@return self
|
||||
function Animate3D:setSpeed (speed) end
|
||||
---@overload fun(cc.Animation3D:cc.Animation3D,float:float,float:float):self
|
||||
---@overload fun(cc.Animation3D:cc.Animation3D):self
|
||||
---@param animation cc.Animation3D
|
||||
---@param fromTime float
|
||||
---@param duration float
|
||||
---@return boolean
|
||||
function Animate3D:init (animation,fromTime,duration) end
|
||||
---* get & set origin interval
|
||||
---@param interval float
|
||||
---@return self
|
||||
function Animate3D:setOriginInterval (interval) end
|
||||
---* get & set blend weight, weight must positive
|
||||
---@return float
|
||||
function Animate3D:getWeight () end
|
||||
---* get animate quality
|
||||
---@return int
|
||||
function Animate3D:getQuality () end
|
||||
---@overload fun(cc.Animation3D:cc.Animation3D,float:float,float:float):self
|
||||
---@overload fun(cc.Animation3D:cc.Animation3D):self
|
||||
---@param animation cc.Animation3D
|
||||
---@param fromTime float
|
||||
---@param duration float
|
||||
---@return self
|
||||
function Animate3D:create (animation,fromTime,duration) end
|
||||
---* get animate transition time between 3d animations
|
||||
---@return float
|
||||
function Animate3D:getTransitionTime () end
|
||||
---* create Animate3D by frame section, [startFrame, endFrame)<br>
|
||||
---* param animation used to generate animate3D<br>
|
||||
---* param startFrame<br>
|
||||
---* param endFrame<br>
|
||||
---* param frameRate default is 30 per second<br>
|
||||
---* return Animate3D created using animate
|
||||
---@param animation cc.Animation3D
|
||||
---@param startFrame int
|
||||
---@param endFrame int
|
||||
---@param frameRate float
|
||||
---@return self
|
||||
function Animate3D:createWithFrames (animation,startFrame,endFrame,frameRate) end
|
||||
---* set animate transition time between 3d animations
|
||||
---@param transTime float
|
||||
---@return self
|
||||
function Animate3D:setTransitionTime (transTime) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function Animate3D:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function Animate3D:reverse () end
|
||||
---*
|
||||
---@return self
|
||||
function Animate3D:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function Animate3D:stop () end
|
||||
---*
|
||||
---@param t float
|
||||
---@return self
|
||||
function Animate3D:update (t) end
|
||||
---*
|
||||
---@param dt float
|
||||
---@return self
|
||||
function Animate3D:step (dt) end
|
||||
---*
|
||||
---@return self
|
||||
function Animate3D:Animate3D () end
|
|
@ -1,110 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Animation :cc.Ref
|
||||
local Animation={ }
|
||||
cc.Animation=Animation
|
||||
|
||||
|
||||
|
||||
|
||||
---* Gets the times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... <br>
|
||||
---* return The times the animation is going to loop.
|
||||
---@return unsigned_int
|
||||
function Animation:getLoops () end
|
||||
---* Adds a SpriteFrame to a Animation.<br>
|
||||
---* param frame The frame will be added with one "delay unit".
|
||||
---@param frame cc.SpriteFrame
|
||||
---@return self
|
||||
function Animation:addSpriteFrame (frame) end
|
||||
---* Sets whether to restore the original frame when animation finishes. <br>
|
||||
---* param restoreOriginalFrame Whether to restore the original frame when animation finishes.
|
||||
---@param restoreOriginalFrame boolean
|
||||
---@return self
|
||||
function Animation:setRestoreOriginalFrame (restoreOriginalFrame) end
|
||||
---*
|
||||
---@return self
|
||||
function Animation:clone () end
|
||||
---* Gets the duration in seconds of the whole animation. It is the result of totalDelayUnits * delayPerUnit.<br>
|
||||
---* return Result of totalDelayUnits * delayPerUnit.
|
||||
---@return float
|
||||
function Animation:getDuration () end
|
||||
---* Initializes a Animation with AnimationFrame.<br>
|
||||
---* since v2.0
|
||||
---@param arrayOfAnimationFrameNames array_table
|
||||
---@param delayPerUnit float
|
||||
---@param loops unsigned_int
|
||||
---@return boolean
|
||||
function Animation:initWithAnimationFrames (arrayOfAnimationFrameNames,delayPerUnit,loops) end
|
||||
---* Initializes a Animation.
|
||||
---@return boolean
|
||||
function Animation:init () end
|
||||
---* Sets the array of AnimationFrames. <br>
|
||||
---* param frames The array of AnimationFrames.
|
||||
---@param frames array_table
|
||||
---@return self
|
||||
function Animation:setFrames (frames) end
|
||||
---* Gets the array of AnimationFrames.<br>
|
||||
---* return The array of AnimationFrames.
|
||||
---@return array_table
|
||||
function Animation:getFrames () end
|
||||
---* Sets the times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... <br>
|
||||
---* param loops The times the animation is going to loop.
|
||||
---@param loops unsigned_int
|
||||
---@return self
|
||||
function Animation:setLoops (loops) end
|
||||
---* Sets the delay in seconds of the "delay unit".<br>
|
||||
---* param delayPerUnit The delay in seconds of the "delay unit".
|
||||
---@param delayPerUnit float
|
||||
---@return self
|
||||
function Animation:setDelayPerUnit (delayPerUnit) end
|
||||
---* Adds a frame with an image filename. Internally it will create a SpriteFrame and it will add it.<br>
|
||||
---* The frame will be added with one "delay unit".<br>
|
||||
---* Added to facilitate the migration from v0.8 to v0.9.<br>
|
||||
---* param filename The path of SpriteFrame.
|
||||
---@param filename string
|
||||
---@return self
|
||||
function Animation:addSpriteFrameWithFile (filename) end
|
||||
---* Gets the total Delay units of the Animation. <br>
|
||||
---* return The total Delay units of the Animation.
|
||||
---@return float
|
||||
function Animation:getTotalDelayUnits () end
|
||||
---* Gets the delay in seconds of the "delay unit".<br>
|
||||
---* return The delay in seconds of the "delay unit".
|
||||
---@return float
|
||||
function Animation:getDelayPerUnit () end
|
||||
---* Initializes a Animation with frames and a delay between frames.<br>
|
||||
---* since v0.99.5
|
||||
---@param arrayOfSpriteFrameNames array_table
|
||||
---@param delay float
|
||||
---@param loops unsigned_int
|
||||
---@return boolean
|
||||
function Animation:initWithSpriteFrames (arrayOfSpriteFrameNames,delay,loops) end
|
||||
---* Checks whether to restore the original frame when animation finishes. <br>
|
||||
---* return Restore the original frame when animation finishes.
|
||||
---@return boolean
|
||||
function Animation:getRestoreOriginalFrame () end
|
||||
---* Adds a frame with a texture and a rect. Internally it will create a SpriteFrame and it will add it.<br>
|
||||
---* The frame will be added with one "delay unit".<br>
|
||||
---* Added to facilitate the migration from v0.8 to v0.9.<br>
|
||||
---* param pobTexture A frame with a texture.<br>
|
||||
---* param rect The Texture of rect.
|
||||
---@param pobTexture cc.Texture2D
|
||||
---@param rect rect_table
|
||||
---@return self
|
||||
function Animation:addSpriteFrameWithTexture (pobTexture,rect) end
|
||||
---@overload fun(array_table:array_table,float:float,unsigned_int:unsigned_int):self
|
||||
---@overload fun():self
|
||||
---@param arrayOfAnimationFrameNames array_table
|
||||
---@param delayPerUnit float
|
||||
---@param loops unsigned_int
|
||||
---@return self
|
||||
function Animation:create (arrayOfAnimationFrameNames,delayPerUnit,loops) end
|
||||
---*
|
||||
---@param arrayOfSpriteFrameNames array_table
|
||||
---@param delay float
|
||||
---@param loops unsigned_int
|
||||
---@return self
|
||||
function Animation:createWithSpriteFrames (arrayOfSpriteFrameNames,delay,loops) end
|
||||
---*
|
||||
---@return self
|
||||
function Animation:Animation () end
|
|
@ -1,29 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Animation3D :cc.Ref
|
||||
local Animation3D={ }
|
||||
cc.Animation3D=Animation3D
|
||||
|
||||
|
||||
|
||||
|
||||
---* init Animation3D with file name and animation name
|
||||
---@param filename string
|
||||
---@param animationName string
|
||||
---@return boolean
|
||||
function Animation3D:initWithFile (filename,animationName) end
|
||||
---* init Animation3D from bundle data
|
||||
---@param data cc.Animation3DData
|
||||
---@return boolean
|
||||
function Animation3D:init (data) end
|
||||
---* get duration
|
||||
---@return float
|
||||
function Animation3D:getDuration () end
|
||||
---* read all animation or only the animation with given animationName? animationName == "" read the first.
|
||||
---@param filename string
|
||||
---@param animationName string
|
||||
---@return self
|
||||
function Animation3D:create (filename,animationName) end
|
||||
---*
|
||||
---@return self
|
||||
function Animation3D:Animation3D () end
|
|
@ -1,61 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AnimationCache :cc.Ref
|
||||
local AnimationCache={ }
|
||||
cc.AnimationCache=AnimationCache
|
||||
|
||||
|
||||
|
||||
|
||||
---* Returns a Animation that was previously added.<br>
|
||||
---* If the name is not found it will return nil.<br>
|
||||
---* You should retain the returned copy if you are going to use it.<br>
|
||||
---* return A Animation that was previously added. If the name is not found it will return nil.
|
||||
---@param name string
|
||||
---@return cc.Animation
|
||||
function AnimationCache:getAnimation (name) end
|
||||
---* Adds a Animation with a name.<br>
|
||||
---* param animation An animation.<br>
|
||||
---* param name The name of animation.
|
||||
---@param animation cc.Animation
|
||||
---@param name string
|
||||
---@return self
|
||||
function AnimationCache:addAnimation (animation,name) end
|
||||
---*
|
||||
---@return boolean
|
||||
function AnimationCache:init () end
|
||||
---* Adds an animation from an NSDictionary.<br>
|
||||
---* Make sure that the frames were previously loaded in the SpriteFrameCache.<br>
|
||||
---* param dictionary An NSDictionary.<br>
|
||||
---* param plist The path of the relative file,it use to find the plist path for load SpriteFrames.<br>
|
||||
---* since v1.1<br>
|
||||
---* js NA
|
||||
---@param dictionary map_table
|
||||
---@param plist string
|
||||
---@return self
|
||||
function AnimationCache:addAnimationsWithDictionary (dictionary,plist) end
|
||||
---* Deletes a Animation from the cache.<br>
|
||||
---* param name The name of animation.
|
||||
---@param name string
|
||||
---@return self
|
||||
function AnimationCache:removeAnimation (name) end
|
||||
---* Adds an animation from a plist file.<br>
|
||||
---* Make sure that the frames were previously loaded in the SpriteFrameCache.<br>
|
||||
---* since v1.1<br>
|
||||
---* js addAnimations<br>
|
||||
---* lua addAnimations<br>
|
||||
---* param plist An animation from a plist file.
|
||||
---@param plist string
|
||||
---@return self
|
||||
function AnimationCache:addAnimationsWithFile (plist) end
|
||||
---* Purges the cache. It releases all the Animation objects and the shared instance.<br>
|
||||
---* js NA
|
||||
---@return self
|
||||
function AnimationCache:destroyInstance () end
|
||||
---* Returns the shared instance of the Animation cache <br>
|
||||
---* js NA
|
||||
---@return self
|
||||
function AnimationCache:getInstance () end
|
||||
---* js ctor
|
||||
---@return self
|
||||
function AnimationCache:AnimationCache () end
|
|
@ -1,58 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AnimationFrame :cc.Ref
|
||||
local AnimationFrame={ }
|
||||
cc.AnimationFrame=AnimationFrame
|
||||
|
||||
|
||||
|
||||
|
||||
---* Set the SpriteFrame.<br>
|
||||
---* param frame A SpriteFrame will be used.
|
||||
---@param frame cc.SpriteFrame
|
||||
---@return self
|
||||
function AnimationFrame:setSpriteFrame (frame) end
|
||||
---@overload fun():self
|
||||
---@overload fun():self
|
||||
---@return map_table
|
||||
function AnimationFrame:getUserInfo () end
|
||||
---* Sets the units of time the frame takes.<br>
|
||||
---* param delayUnits The units of time the frame takes.
|
||||
---@param delayUnits float
|
||||
---@return self
|
||||
function AnimationFrame:setDelayUnits (delayUnits) end
|
||||
---*
|
||||
---@return self
|
||||
function AnimationFrame:clone () end
|
||||
---* Return a SpriteFrameName to be used.<br>
|
||||
---* return a SpriteFrameName to be used.
|
||||
---@return cc.SpriteFrame
|
||||
function AnimationFrame:getSpriteFrame () end
|
||||
---* Gets the units of time the frame takes.<br>
|
||||
---* return The units of time the frame takes.
|
||||
---@return float
|
||||
function AnimationFrame:getDelayUnits () end
|
||||
---* Sets user information.<br>
|
||||
---* param userInfo A dictionary as UserInfo.
|
||||
---@param userInfo map_table
|
||||
---@return self
|
||||
function AnimationFrame:setUserInfo (userInfo) end
|
||||
---* initializes the animation frame with a spriteframe, number of delay units and a notification user info
|
||||
---@param spriteFrame cc.SpriteFrame
|
||||
---@param delayUnits float
|
||||
---@param userInfo map_table
|
||||
---@return boolean
|
||||
function AnimationFrame:initWithSpriteFrame (spriteFrame,delayUnits,userInfo) end
|
||||
---* Creates the animation frame with a spriteframe, number of delay units and a notification user info.<br>
|
||||
---* param spriteFrame The animation frame with a spriteframe.<br>
|
||||
---* param delayUnits Number of delay units.<br>
|
||||
---* param userInfo A notification user info.<br>
|
||||
---* since 3.0
|
||||
---@param spriteFrame cc.SpriteFrame
|
||||
---@param delayUnits float
|
||||
---@param userInfo map_table
|
||||
---@return self
|
||||
function AnimationFrame:create (spriteFrame,delayUnits,userInfo) end
|
||||
---* js ctor
|
||||
---@return self
|
||||
function AnimationFrame:AnimationFrame () end
|
|
@ -1,38 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Application
|
||||
local Application={ }
|
||||
cc.Application=Application
|
||||
|
||||
|
||||
|
||||
|
||||
---* brief Get target platform
|
||||
---@return int
|
||||
function Application:getTargetPlatform () end
|
||||
---* brief Get current language config<br>
|
||||
---* return Current language config
|
||||
---@return int
|
||||
function Application:getCurrentLanguage () end
|
||||
---* brief Get current language iso 639-1 code<br>
|
||||
---* return Current language iso 639-1 code
|
||||
---@return char
|
||||
function Application:getCurrentLanguageCode () end
|
||||
---* brief Open url in default browser<br>
|
||||
---* param String with url to open.<br>
|
||||
---* return true if the resource located by the URL was successfully opened; otherwise false.
|
||||
---@param url string
|
||||
---@return boolean
|
||||
function Application:openURL (url) end
|
||||
---* brief Get application version.
|
||||
---@return string
|
||||
function Application:getVersion () end
|
||||
---* brief Callback by Director to limit FPS.<br>
|
||||
---* param interval The time, expressed in seconds, between current frame and next.
|
||||
---@param interval float
|
||||
---@return self
|
||||
function Application:setAnimationInterval (interval) end
|
||||
---* brief Get current application instance.<br>
|
||||
---* return Current application instance pointer.
|
||||
---@return self
|
||||
function Application:getInstance () end
|
|
@ -1,61 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AssetsManager :cc.Node
|
||||
local AssetsManager={ }
|
||||
cc.AssetsManager=AssetsManager
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param storagePath char
|
||||
---@return self
|
||||
function AssetsManager:setStoragePath (storagePath) end
|
||||
---*
|
||||
---@param packageUrl char
|
||||
---@return self
|
||||
function AssetsManager:setPackageUrl (packageUrl) end
|
||||
---*
|
||||
---@return boolean
|
||||
function AssetsManager:checkUpdate () end
|
||||
---*
|
||||
---@return char
|
||||
function AssetsManager:getStoragePath () end
|
||||
---*
|
||||
---@return self
|
||||
function AssetsManager:update () end
|
||||
---* @brief Sets connection time out in seconds
|
||||
---@param timeout unsigned_int
|
||||
---@return self
|
||||
function AssetsManager:setConnectionTimeout (timeout) end
|
||||
---*
|
||||
---@param versionFileUrl char
|
||||
---@return self
|
||||
function AssetsManager:setVersionFileUrl (versionFileUrl) end
|
||||
---*
|
||||
---@return char
|
||||
function AssetsManager:getPackageUrl () end
|
||||
---* @brief Gets connection time out in seconds
|
||||
---@return unsigned_int
|
||||
function AssetsManager:getConnectionTimeout () end
|
||||
---*
|
||||
---@return string
|
||||
function AssetsManager:getVersion () end
|
||||
---*
|
||||
---@return char
|
||||
function AssetsManager:getVersionFileUrl () end
|
||||
---*
|
||||
---@return self
|
||||
function AssetsManager:deleteVersion () end
|
||||
---*
|
||||
---@param packageUrl char
|
||||
---@param versionFileUrl char
|
||||
---@param storagePath char
|
||||
---@param errorCallback function
|
||||
---@param progressCallback function
|
||||
---@param successCallback function
|
||||
---@return self
|
||||
function AssetsManager:create (packageUrl,versionFileUrl,storagePath,errorCallback,progressCallback,successCallback) end
|
||||
---*
|
||||
---@return self
|
||||
function AssetsManager:AssetsManager () end
|
|
@ -1,63 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AssetsManagerEx :cc.Ref
|
||||
local AssetsManagerEx={ }
|
||||
cc.AssetsManagerEx=AssetsManagerEx
|
||||
|
||||
|
||||
|
||||
|
||||
---* @brief Gets the current update state.
|
||||
---@return int
|
||||
function AssetsManagerEx:getState () end
|
||||
---* @brief Function for retrieving the max concurrent task count
|
||||
---@return int
|
||||
function AssetsManagerEx:getMaxConcurrentTask () end
|
||||
---* @brief Check out if there is a new version of manifest.<br>
|
||||
---* You may use this method before updating, then let user determine whether<br>
|
||||
---* he wants to update resources.
|
||||
---@return self
|
||||
function AssetsManagerEx:checkUpdate () end
|
||||
---* @brief Set the verification function for checking whether downloaded asset is correct, e.g. using md5 verification<br>
|
||||
---* param callback The verify callback function
|
||||
---@param callback function
|
||||
---@return self
|
||||
function AssetsManagerEx:setVerifyCallback (callback) end
|
||||
---* @brief Gets storage path.
|
||||
---@return string
|
||||
function AssetsManagerEx:getStoragePath () end
|
||||
---* @brief Update with the current local manifest.
|
||||
---@return self
|
||||
function AssetsManagerEx:update () end
|
||||
---* @brief Set the handle function for comparing manifests versions<br>
|
||||
---* param handle The compare function
|
||||
---@param handle function
|
||||
---@return self
|
||||
function AssetsManagerEx:setVersionCompareHandle (handle) end
|
||||
---* @brief Function for setting the max concurrent task count
|
||||
---@param max int
|
||||
---@return self
|
||||
function AssetsManagerEx:setMaxConcurrentTask (max) end
|
||||
---* @brief Function for retrieving the local manifest object
|
||||
---@return cc.Manifest
|
||||
function AssetsManagerEx:getLocalManifest () end
|
||||
---* @brief Function for retrieving the remote manifest object
|
||||
---@return cc.Manifest
|
||||
function AssetsManagerEx:getRemoteManifest () end
|
||||
---* @brief Reupdate all failed assets under the current AssetsManagerEx context
|
||||
---@return self
|
||||
function AssetsManagerEx:downloadFailedAssets () end
|
||||
---* @brief Create function for creating a new AssetsManagerEx<br>
|
||||
---* param manifestUrl The url for the local manifest file<br>
|
||||
---* param storagePath The storage path for downloaded assets<br>
|
||||
---* warning The cached manifest in your storage path have higher priority and will be searched first,<br>
|
||||
---* only if it doesn't exist, AssetsManagerEx will use the given manifestUrl.
|
||||
---@param manifestUrl string
|
||||
---@param storagePath string
|
||||
---@return self
|
||||
function AssetsManagerEx:create (manifestUrl,storagePath) end
|
||||
---*
|
||||
---@param manifestUrl string
|
||||
---@param storagePath string
|
||||
---@return self
|
||||
function AssetsManagerEx:AssetsManagerEx (manifestUrl,storagePath) end
|
|
@ -1,31 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AsyncTaskPool
|
||||
local AsyncTaskPool={ }
|
||||
cc.AsyncTaskPool=AsyncTaskPool
|
||||
|
||||
|
||||
|
||||
|
||||
---@overload fun(int:int,function:function):self
|
||||
---@overload fun(int:int,function:function,void:void,function:function):self
|
||||
---@param type int
|
||||
---@param callback function
|
||||
---@param callbackParam void
|
||||
---@param task function
|
||||
---@return self
|
||||
function AsyncTaskPool:enqueue (type,callback,callbackParam,task) end
|
||||
---* Stop tasks.<br>
|
||||
---* param type Task type you want to stop.
|
||||
---@param type int
|
||||
---@return self
|
||||
function AsyncTaskPool:stopTasks (type) end
|
||||
---* Destroys the async task pool.
|
||||
---@return self
|
||||
function AsyncTaskPool:destroyInstance () end
|
||||
---* Returns the shared instance of the async task pool.
|
||||
---@return self
|
||||
function AsyncTaskPool:getInstance () end
|
||||
---*
|
||||
---@return self
|
||||
function AsyncTaskPool:AsyncTaskPool () end
|
|
@ -1,98 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AtlasNode :cc.Node@all parent class: Node,TextureProtocol
|
||||
local AtlasNode={ }
|
||||
cc.AtlasNode=AtlasNode
|
||||
|
||||
|
||||
|
||||
|
||||
---* lua NA
|
||||
---@return cc.BlendFunc
|
||||
function AtlasNode:getBlendFunc () end
|
||||
---* Initializes an AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
|
||||
---@param tile string
|
||||
---@param tileWidth int
|
||||
---@param tileHeight int
|
||||
---@param itemsToRender int
|
||||
---@return boolean
|
||||
function AtlasNode:initWithTileFile (tile,tileWidth,tileHeight,itemsToRender) end
|
||||
---* code<br>
|
||||
---* When this function bound into js or lua,the parameter will be changed<br>
|
||||
---* In js: var setBlendFunc(var src, var dst)<br>
|
||||
---* endcode<br>
|
||||
---* lua NA
|
||||
---@param blendFunc cc.BlendFunc
|
||||
---@return self
|
||||
function AtlasNode:setBlendFunc (blendFunc) end
|
||||
---* Set an buffer manager of the texture vertex.
|
||||
---@param textureAtlas cc.TextureAtlas
|
||||
---@return self
|
||||
function AtlasNode:setTextureAtlas (textureAtlas) end
|
||||
---*
|
||||
---@return cc.Texture2D
|
||||
function AtlasNode:getTexture () end
|
||||
---* Return the buffer manager of the texture vertex. <br>
|
||||
---* return Return A TextureAtlas.
|
||||
---@return cc.TextureAtlas
|
||||
function AtlasNode:getTextureAtlas () end
|
||||
---* updates the Atlas (indexed vertex array).<br>
|
||||
---* Shall be overridden in subclasses.
|
||||
---@return self
|
||||
function AtlasNode:updateAtlasValues () end
|
||||
---*
|
||||
---@param texture cc.Texture2D
|
||||
---@return self
|
||||
function AtlasNode:setTexture (texture) end
|
||||
---* Initializes an AtlasNode with a texture the width and height of each item measured in points and the quantity of items to render
|
||||
---@param texture cc.Texture2D
|
||||
---@param tileWidth int
|
||||
---@param tileHeight int
|
||||
---@param itemsToRender int
|
||||
---@return boolean
|
||||
function AtlasNode:initWithTexture (texture,tileWidth,tileHeight,itemsToRender) end
|
||||
---*
|
||||
---@return unsigned_int
|
||||
function AtlasNode:getQuadsToDraw () end
|
||||
---*
|
||||
---@param quadsToDraw int
|
||||
---@return self
|
||||
function AtlasNode:setQuadsToDraw (quadsToDraw) end
|
||||
---* creates a AtlasNode with an Atlas file the width and height of each item and the quantity of items to render.<br>
|
||||
---* param filename The path of Atlas file.<br>
|
||||
---* param tileWidth The width of the item.<br>
|
||||
---* param tileHeight The height of the item.<br>
|
||||
---* param itemsToRender The quantity of items to render.
|
||||
---@param filename string
|
||||
---@param tileWidth int
|
||||
---@param tileHeight int
|
||||
---@param itemsToRender int
|
||||
---@return self
|
||||
function AtlasNode:create (filename,tileWidth,tileHeight,itemsToRender) end
|
||||
---*
|
||||
---@param renderer cc.Renderer
|
||||
---@param transform mat4_table
|
||||
---@param flags unsigned_int
|
||||
---@return self
|
||||
function AtlasNode:draw (renderer,transform,flags) end
|
||||
---*
|
||||
---@return boolean
|
||||
function AtlasNode:isOpacityModifyRGB () end
|
||||
---*
|
||||
---@param color color3b_table
|
||||
---@return self
|
||||
function AtlasNode:setColor (color) end
|
||||
---*
|
||||
---@return color3b_table
|
||||
function AtlasNode:getColor () end
|
||||
---*
|
||||
---@param isOpacityModifyRGB boolean
|
||||
---@return self
|
||||
function AtlasNode:setOpacityModifyRGB (isOpacityModifyRGB) end
|
||||
---*
|
||||
---@param opacity unsigned_char
|
||||
---@return self
|
||||
function AtlasNode:setOpacity (opacity) end
|
||||
---*
|
||||
---@return self
|
||||
function AtlasNode:AtlasNode () end
|
|
@ -1,32 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AttachNode :cc.Node
|
||||
local AttachNode={ }
|
||||
cc.AttachNode=AttachNode
|
||||
|
||||
|
||||
|
||||
|
||||
---* creates an AttachNode<br>
|
||||
---* param attachBone The bone to which the AttachNode is going to attach, the attacheBone must be a bone of the AttachNode's parent
|
||||
---@param attachBone cc.Bone3D
|
||||
---@return self
|
||||
function AttachNode:create (attachBone) end
|
||||
---*
|
||||
---@param renderer cc.Renderer
|
||||
---@param parentTransform mat4_table
|
||||
---@param parentFlags unsigned_int
|
||||
---@return self
|
||||
function AttachNode:visit (renderer,parentTransform,parentFlags) end
|
||||
---*
|
||||
---@return mat4_table
|
||||
function AttachNode:getWorldToNodeTransform () end
|
||||
---*
|
||||
---@return mat4_table
|
||||
function AttachNode:getNodeToWorldTransform () end
|
||||
---*
|
||||
---@return mat4_table
|
||||
function AttachNode:getNodeToParentTransform () end
|
||||
---*
|
||||
---@return self
|
||||
function AttachNode:AttachNode () end
|
|
@ -1,151 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AudioEngine
|
||||
local AudioEngine={ }
|
||||
cc.AudioEngine=AudioEngine
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@return boolean
|
||||
function AudioEngine:lazyInit () end
|
||||
---* Sets the current playback position of an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* param sec The offset in seconds from the start to seek to.<br>
|
||||
---* return
|
||||
---@param audioID int
|
||||
---@param sec float
|
||||
---@return boolean
|
||||
function AudioEngine:setCurrentTime (audioID,sec) end
|
||||
---* Gets the volume value of an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* return Volume value (range from 0.0 to 1.0).
|
||||
---@param audioID int
|
||||
---@return float
|
||||
function AudioEngine:getVolume (audioID) end
|
||||
---* Uncache the audio data from internal buffer.<br>
|
||||
---* AudioEngine cache audio data on ios,mac, and win32 platform.<br>
|
||||
---* warning This can lead to stop related audio first.<br>
|
||||
---* param filePath Audio file path.
|
||||
---@param filePath string
|
||||
---@return self
|
||||
function AudioEngine:uncache (filePath) end
|
||||
---* Resume all suspended audio instances.
|
||||
---@return self
|
||||
function AudioEngine:resumeAll () end
|
||||
---* Stop all audio instances.
|
||||
---@return self
|
||||
function AudioEngine:stopAll () end
|
||||
---* Pause an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.
|
||||
---@param audioID int
|
||||
---@return self
|
||||
function AudioEngine:pause (audioID) end
|
||||
---* Gets the maximum number of simultaneous audio instance of AudioEngine.
|
||||
---@return int
|
||||
function AudioEngine:getMaxAudioInstance () end
|
||||
---* Check whether AudioEngine is enabled.
|
||||
---@return boolean
|
||||
function AudioEngine:isEnabled () end
|
||||
---* Gets the current playback position of an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* return The current playback position of an audio instance.
|
||||
---@param audioID int
|
||||
---@return float
|
||||
function AudioEngine:getCurrentTime (audioID) end
|
||||
---* Sets the maximum number of simultaneous audio instance for AudioEngine.<br>
|
||||
---* param maxInstances The maximum number of simultaneous audio instance.
|
||||
---@param maxInstances int
|
||||
---@return boolean
|
||||
function AudioEngine:setMaxAudioInstance (maxInstances) end
|
||||
---* Checks whether an audio instance is loop.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* return Whether or not an audio instance is loop.
|
||||
---@param audioID int
|
||||
---@return boolean
|
||||
function AudioEngine:isLoop (audioID) end
|
||||
---* Pause all playing audio instances.
|
||||
---@return self
|
||||
function AudioEngine:pauseAll () end
|
||||
---* Uncache all audio data from internal buffer.<br>
|
||||
---* warning All audio will be stopped first.
|
||||
---@return self
|
||||
function AudioEngine:uncacheAll () end
|
||||
---* Sets volume for an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* param volume Volume value (range from 0.0 to 1.0).
|
||||
---@param audioID int
|
||||
---@param volume float
|
||||
---@return self
|
||||
function AudioEngine:setVolume (audioID,volume) end
|
||||
---@overload fun(string:string,function:function):self
|
||||
---@overload fun(string:string):self
|
||||
---@param filePath string
|
||||
---@param callback function
|
||||
---@return self
|
||||
function AudioEngine:preload (filePath,callback) end
|
||||
---* Whether to enable playing audios<br>
|
||||
---* note If it's disabled, current playing audios will be stopped and the later 'preload', 'play2d' methods will take no effects.
|
||||
---@param isEnabled boolean
|
||||
---@return self
|
||||
function AudioEngine:setEnabled (isEnabled) end
|
||||
---* Play 2d sound.<br>
|
||||
---* param filePath The path of an audio file.<br>
|
||||
---* param loop Whether audio instance loop or not.<br>
|
||||
---* param volume Volume value (range from 0.0 to 1.0).<br>
|
||||
---* param profile A profile for audio instance. When profile is not specified, default profile will be used.<br>
|
||||
---* return An audio ID. It allows you to dynamically change the behavior of an audio instance on the fly.<br>
|
||||
---* see `AudioProfile`
|
||||
---@param filePath string
|
||||
---@param loop boolean
|
||||
---@param volume float
|
||||
---@param profile cc.AudioProfile
|
||||
---@return int
|
||||
function AudioEngine:play2d (filePath,loop,volume,profile) end
|
||||
---* Returns the state of an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* return The status of an audio instance.
|
||||
---@param audioID int
|
||||
---@return int
|
||||
function AudioEngine:getState (audioID) end
|
||||
---* Resume an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.
|
||||
---@param audioID int
|
||||
---@return self
|
||||
function AudioEngine:resume (audioID) end
|
||||
---* Stop an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.
|
||||
---@param audioID int
|
||||
---@return self
|
||||
function AudioEngine:stop (audioID) end
|
||||
---* Release objects relating to AudioEngine.<br>
|
||||
---* warning It must be called before the application exit.<br>
|
||||
---* lua endToLua
|
||||
---@return self
|
||||
function AudioEngine:endToLua () end
|
||||
---* Gets the duration of an audio instance.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* return The duration of an audio instance.
|
||||
---@param audioID int
|
||||
---@return float
|
||||
function AudioEngine:getDuration (audioID) end
|
||||
---* Sets whether an audio instance loop or not.<br>
|
||||
---* param audioID An audioID returned by the play2d function.<br>
|
||||
---* param loop Whether audio instance loop or not.
|
||||
---@param audioID int
|
||||
---@param loop boolean
|
||||
---@return self
|
||||
function AudioEngine:setLoop (audioID,loop) end
|
||||
---* Gets the default profile of audio instances.<br>
|
||||
---* return The default profile of audio instances.
|
||||
---@return cc.AudioProfile
|
||||
function AudioEngine:getDefaultProfile () end
|
||||
---@overload fun(int0:string):self
|
||||
---@overload fun(int:int):self
|
||||
---@param audioID int
|
||||
---@return cc.AudioProfile
|
||||
function AudioEngine:getProfile (audioID) end
|
||||
---* Gets playing audio count.
|
||||
---@return int
|
||||
function AudioEngine:getPlayingAudioCount () end
|
|
@ -1,13 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AudioProfile
|
||||
local AudioProfile={ }
|
||||
cc.AudioProfile=AudioProfile
|
||||
|
||||
|
||||
|
||||
|
||||
---* Default constructor<br>
|
||||
---* lua new
|
||||
---@return self
|
||||
function AudioProfile:AudioProfile () end
|
|
@ -1,16 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.AutoPolygon
|
||||
local AutoPolygon={ }
|
||||
cc.AutoPolygon=AutoPolygon
|
||||
|
||||
|
||||
|
||||
|
||||
---* create an AutoPolygon and initialize it with an image file<br>
|
||||
---* the image must be a 32bit PNG for current version 3.7<br>
|
||||
---* param filename a path to image file, e.g., "scene1/monster.png".<br>
|
||||
---* return an AutoPolygon object;
|
||||
---@param filename string
|
||||
---@return self
|
||||
function AutoPolygon:AutoPolygon (filename) end
|
|
@ -1,34 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.BaseLight :cc.Node
|
||||
local BaseLight={ }
|
||||
cc.BaseLight=BaseLight
|
||||
|
||||
|
||||
|
||||
|
||||
---* light enabled getter and setter.
|
||||
---@param enabled boolean
|
||||
---@return self
|
||||
function BaseLight:setEnabled (enabled) end
|
||||
---* intensity getter and setter
|
||||
---@return float
|
||||
function BaseLight:getIntensity () end
|
||||
---*
|
||||
---@return boolean
|
||||
function BaseLight:isEnabled () end
|
||||
---* Get the light type,light type MUST be one of LightType::DIRECTIONAL ,<br>
|
||||
---* LightType::POINT, LightType::SPOT, LightType::AMBIENT.
|
||||
---@return int
|
||||
function BaseLight:getLightType () end
|
||||
---*
|
||||
---@param flag int
|
||||
---@return self
|
||||
function BaseLight:setLightFlag (flag) end
|
||||
---*
|
||||
---@param intensity float
|
||||
---@return self
|
||||
function BaseLight:setIntensity (intensity) end
|
||||
---* light flag getter and setter
|
||||
---@return int
|
||||
function BaseLight:getLightFlag () end
|
|
@ -1,32 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.BezierBy :cc.ActionInterval
|
||||
local BezierBy={ }
|
||||
cc.BezierBy=BezierBy
|
||||
|
||||
|
||||
|
||||
|
||||
---* initializes the action with a duration and a bezier configuration<br>
|
||||
---* param t in seconds
|
||||
---@param t float
|
||||
---@param c cc._ccBezierConfig
|
||||
---@return boolean
|
||||
function BezierBy:initWithDuration (t,c) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function BezierBy:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function BezierBy:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function BezierBy:reverse () end
|
||||
---* param time In seconds.
|
||||
---@param time float
|
||||
---@return self
|
||||
function BezierBy:update (time) end
|
||||
---*
|
||||
---@return self
|
||||
function BezierBy:BezierBy () end
|
|
@ -1,27 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.BezierTo :cc.BezierBy
|
||||
local BezierTo={ }
|
||||
cc.BezierTo=BezierTo
|
||||
|
||||
|
||||
|
||||
|
||||
---* param t In seconds.
|
||||
---@param t float
|
||||
---@param c cc._ccBezierConfig
|
||||
---@return boolean
|
||||
function BezierTo:initWithDuration (t,c) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function BezierTo:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function BezierTo:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function BezierTo:reverse () end
|
||||
---*
|
||||
---@return self
|
||||
function BezierTo:BezierTo () end
|
|
@ -1,41 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.BillBoard :cc.Sprite
|
||||
local BillBoard={ }
|
||||
cc.BillBoard=BillBoard
|
||||
|
||||
|
||||
|
||||
|
||||
---* Get the billboard rotation mode.
|
||||
---@return int
|
||||
function BillBoard:getMode () end
|
||||
---* Set the billboard rotation mode.
|
||||
---@param mode int
|
||||
---@return self
|
||||
function BillBoard:setMode (mode) end
|
||||
---@overload fun(string:string,rect_table1:int):self
|
||||
---@overload fun(string0:int):self
|
||||
---@overload fun(string:string,rect_table:rect_table,int:int):self
|
||||
---@param filename string
|
||||
---@param rect rect_table
|
||||
---@param mode int
|
||||
---@return self
|
||||
function BillBoard:create (filename,rect,mode) end
|
||||
---* Creates a BillBoard with a Texture2D object.<br>
|
||||
---* After creation, the rect will be the size of the texture, and the offset will be (0,0).<br>
|
||||
---* param texture A pointer to a Texture2D object.<br>
|
||||
---* return An autoreleased BillBoard object
|
||||
---@param texture cc.Texture2D
|
||||
---@param mode int
|
||||
---@return self
|
||||
function BillBoard:createWithTexture (texture,mode) end
|
||||
---* update billboard's transform and turn it towards camera
|
||||
---@param renderer cc.Renderer
|
||||
---@param parentTransform mat4_table
|
||||
---@param parentFlags unsigned_int
|
||||
---@return self
|
||||
function BillBoard:visit (renderer,parentTransform,parentFlags) end
|
||||
---*
|
||||
---@return self
|
||||
function BillBoard:BillBoard () end
|
|
@ -1,43 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Blink :cc.ActionInterval
|
||||
local Blink={ }
|
||||
cc.Blink=Blink
|
||||
|
||||
|
||||
|
||||
|
||||
---* initializes the action <br>
|
||||
---* param duration in seconds
|
||||
---@param duration float
|
||||
---@param blinks int
|
||||
---@return boolean
|
||||
function Blink:initWithDuration (duration,blinks) end
|
||||
---* Creates the action.<br>
|
||||
---* param duration Duration time, in seconds.<br>
|
||||
---* param blinks Blink times.<br>
|
||||
---* return An autoreleased Blink object.
|
||||
---@param duration float
|
||||
---@param blinks int
|
||||
---@return self
|
||||
function Blink:create (duration,blinks) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function Blink:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function Blink:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function Blink:stop () end
|
||||
---*
|
||||
---@return self
|
||||
function Blink:reverse () end
|
||||
---* param time In seconds.
|
||||
---@param time float
|
||||
---@return self
|
||||
function Blink:update (time) end
|
||||
---*
|
||||
---@return self
|
||||
function Blink:Blink () end
|
|
@ -1,59 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Bundle3D
|
||||
local Bundle3D={ }
|
||||
cc.Bundle3D=Bundle3D
|
||||
|
||||
|
||||
|
||||
|
||||
---* load a file. You must load a file first, then call loadMeshData, loadSkinData, and so on<br>
|
||||
---* param path File to be loaded<br>
|
||||
---* return result of load
|
||||
---@param path string
|
||||
---@return boolean
|
||||
function Bundle3D:load (path) end
|
||||
---* load skin data from bundle<br>
|
||||
---* param id The ID of the skin, load the first Skin in the bundle if it is empty
|
||||
---@param id string
|
||||
---@param skindata cc.SkinData
|
||||
---@return boolean
|
||||
function Bundle3D:loadSkinData (id,skindata) end
|
||||
---*
|
||||
---@return self
|
||||
function Bundle3D:clear () end
|
||||
---*
|
||||
---@param materialdatas cc.MaterialDatas
|
||||
---@return boolean
|
||||
function Bundle3D:loadMaterials (materialdatas) end
|
||||
---*
|
||||
---@param nodedatas cc.NodeDatas
|
||||
---@return boolean
|
||||
function Bundle3D:loadNodes (nodedatas) end
|
||||
---* load material data from bundle<br>
|
||||
---* param id The ID of the animation, load the first animation in the bundle if it is empty
|
||||
---@param id string
|
||||
---@param animationdata cc.Animation3DData
|
||||
---@return boolean
|
||||
function Bundle3D:loadAnimationData (id,animationdata) end
|
||||
---* get define data type<br>
|
||||
---* param str The type in string
|
||||
---@param str string
|
||||
---@return int
|
||||
function Bundle3D:parseSamplerAddressMode (str) end
|
||||
---*
|
||||
---@param bundle cc.Bundle3D
|
||||
---@return self
|
||||
function Bundle3D:destroyBundle (bundle) end
|
||||
---* create a new bundle, destroy it when finish using it
|
||||
---@return self
|
||||
function Bundle3D:createBundle () end
|
||||
---* get define data type<br>
|
||||
---* param str The type in string
|
||||
---@param str string
|
||||
---@param size int
|
||||
---@return int
|
||||
function Bundle3D:parseGLDataType (str,size) end
|
||||
---*
|
||||
---@return self
|
||||
function Bundle3D:Bundle3D () end
|
|
@ -1,68 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CSLoader
|
||||
local CSLoader={ }
|
||||
cc.CSLoader=CSLoader
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param filename string
|
||||
---@return cc.Node
|
||||
function CSLoader:createNodeFromJson (filename) end
|
||||
---*
|
||||
---@param filename string
|
||||
---@return cc.Node
|
||||
function CSLoader:createNodeWithFlatBuffersFile (filename) end
|
||||
---*
|
||||
---@param fileName string
|
||||
---@return cc.Node
|
||||
function CSLoader:loadNodeWithFile (fileName) end
|
||||
---*
|
||||
---@param callbackName string
|
||||
---@param callbackType string
|
||||
---@param sender ccui.Widget
|
||||
---@param handler cc.Node
|
||||
---@return boolean
|
||||
function CSLoader:bindCallback (callbackName,callbackType,sender,handler) end
|
||||
---*
|
||||
---@param jsonPath string
|
||||
---@return self
|
||||
function CSLoader:setJsonPath (jsonPath) end
|
||||
---*
|
||||
---@return self
|
||||
function CSLoader:init () end
|
||||
---*
|
||||
---@param content string
|
||||
---@return cc.Node
|
||||
function CSLoader:loadNodeWithContent (content) end
|
||||
---*
|
||||
---@return boolean
|
||||
function CSLoader:isRecordJsonPath () end
|
||||
---*
|
||||
---@return string
|
||||
function CSLoader:getJsonPath () end
|
||||
---*
|
||||
---@param record boolean
|
||||
---@return self
|
||||
function CSLoader:setRecordJsonPath (record) end
|
||||
---*
|
||||
---@param filename string
|
||||
---@return cc.Node
|
||||
function CSLoader:createNodeWithFlatBuffersForSimulator (filename) end
|
||||
---*
|
||||
---@return self
|
||||
function CSLoader:destroyInstance () end
|
||||
---@overload fun(string:string,function:function):self
|
||||
---@overload fun(string:string):self
|
||||
---@param filename string
|
||||
---@param callback function
|
||||
---@return cc.Node
|
||||
function CSLoader:createNodeWithVisibleSize (filename,callback) end
|
||||
---*
|
||||
---@return self
|
||||
function CSLoader:getInstance () end
|
||||
---*
|
||||
---@return self
|
||||
function CSLoader:CSLoader () end
|
|
@ -1,25 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CallFunc :cc.ActionInstant
|
||||
local CallFunc={ }
|
||||
cc.CallFunc=CallFunc
|
||||
|
||||
|
||||
|
||||
|
||||
---* Executes the callback.
|
||||
---@return self
|
||||
function CallFunc:execute () end
|
||||
---*
|
||||
---@return self
|
||||
function CallFunc:clone () end
|
||||
---* param time In seconds.
|
||||
---@param time float
|
||||
---@return self
|
||||
function CallFunc:update (time) end
|
||||
---*
|
||||
---@return self
|
||||
function CallFunc:reverse () end
|
||||
---*
|
||||
---@return self
|
||||
function CallFunc:CallFunc () end
|
|
@ -1,166 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.Camera :cc.Node
|
||||
local Camera={ }
|
||||
cc.Camera=Camera
|
||||
|
||||
|
||||
|
||||
|
||||
---* get depth, camera with larger depth is drawn on top of camera with smaller depth, the depth of camera with CameraFlag::DEFAULT is 0, user defined camera is -1 by default
|
||||
---@return char
|
||||
function Camera:getDepth () end
|
||||
---* get view projection matrix
|
||||
---@return mat4_table
|
||||
function Camera:getViewProjectionMatrix () end
|
||||
---*
|
||||
---@return self
|
||||
function Camera:applyViewport () end
|
||||
---* set the background brush. See CameraBackgroundBrush for more information.<br>
|
||||
---* param clearBrush Brush used to clear the background
|
||||
---@param clearBrush cc.CameraBackgroundBrush
|
||||
---@return self
|
||||
function Camera:setBackgroundBrush (clearBrush) end
|
||||
---* Make Camera looks at target<br>
|
||||
---* param target The target camera is point at<br>
|
||||
---* param up The up vector, usually it's Y axis
|
||||
---@param target vec3_table
|
||||
---@param up vec3_table
|
||||
---@return self
|
||||
function Camera:lookAt (target,up) end
|
||||
---* Apply the FBO, RenderTargets and viewport.
|
||||
---@return self
|
||||
function Camera:apply () end
|
||||
---* Get clear brush
|
||||
---@return cc.CameraBackgroundBrush
|
||||
function Camera:getBackgroundBrush () end
|
||||
---* Gets the camera's projection matrix.<br>
|
||||
---* return The camera projection matrix.
|
||||
---@return mat4_table
|
||||
function Camera:getProjectionMatrix () end
|
||||
---*
|
||||
---@return boolean
|
||||
function Camera:isBrushValid () end
|
||||
---* Get object depth towards camera
|
||||
---@param transform mat4_table
|
||||
---@return float
|
||||
function Camera:getDepthInView (transform) end
|
||||
---* Before rendering scene with this camera, the background need to be cleared. It clears the depth buffer with max depth by default. Use setBackgroundBrush to modify the default behavior
|
||||
---@return self
|
||||
function Camera:clearBackground () end
|
||||
---* set additional matrix for the projection matrix, it multiplies mat to projection matrix when called, used by WP8
|
||||
---@param mat mat4_table
|
||||
---@return self
|
||||
function Camera:setAdditionalProjection (mat) end
|
||||
---* init camera
|
||||
---@return boolean
|
||||
function Camera:initDefault () end
|
||||
---* get & set Camera flag
|
||||
---@return int
|
||||
function Camera:getCameraFlag () end
|
||||
---* Gets the type of camera.<br>
|
||||
---* return The camera type.
|
||||
---@return int
|
||||
function Camera:getType () end
|
||||
---*
|
||||
---@param zoomX float
|
||||
---@param zoomY float
|
||||
---@param nearPlane float
|
||||
---@param farPlane float
|
||||
---@return boolean
|
||||
function Camera:initOrthographic (zoomX,zoomY,nearPlane,farPlane) end
|
||||
---* get rendered order
|
||||
---@return int
|
||||
function Camera:getRenderOrder () end
|
||||
---* Is this aabb visible in frustum
|
||||
---@param aabb cc.AABB
|
||||
---@return boolean
|
||||
function Camera:isVisibleInFrustum (aabb) end
|
||||
---* set depth, camera with larger depth is drawn on top of camera with smaller depth, the depth of camera with CameraFlag::DEFAULT is 0, user defined camera is -1 by default
|
||||
---@param depth char
|
||||
---@return self
|
||||
function Camera:setDepth (depth) end
|
||||
---* Set the scene,this method shall not be invoke manually
|
||||
---@param scene cc.Scene
|
||||
---@return self
|
||||
function Camera:setScene (scene) end
|
||||
---*
|
||||
---@param src vec3_table
|
||||
---@return vec2_table
|
||||
function Camera:projectGL (src) end
|
||||
---* Gets the camera's view matrix.<br>
|
||||
---* return The camera view matrix.
|
||||
---@return mat4_table
|
||||
function Camera:getViewMatrix () end
|
||||
---* Get the frustum's near plane.
|
||||
---@return float
|
||||
function Camera:getNearPlane () end
|
||||
---*
|
||||
---@param src vec3_table
|
||||
---@return vec2_table
|
||||
function Camera:project (src) end
|
||||
---*
|
||||
---@param flag int
|
||||
---@return self
|
||||
function Camera:setCameraFlag (flag) end
|
||||
---* Get the frustum's far plane.
|
||||
---@return float
|
||||
function Camera:getFarPlane () end
|
||||
---* Whether or not the viewprojection matrix was updated since the last frame.<br>
|
||||
---* return True if the viewprojection matrix was updated since the last frame.
|
||||
---@return boolean
|
||||
function Camera:isViewProjectionUpdated () end
|
||||
---*
|
||||
---@param fieldOfView float
|
||||
---@param aspectRatio float
|
||||
---@param nearPlane float
|
||||
---@param farPlane float
|
||||
---@return boolean
|
||||
function Camera:initPerspective (fieldOfView,aspectRatio,nearPlane,farPlane) end
|
||||
---* Creates an orthographic camera.<br>
|
||||
---* param zoomX The zoom factor along the X-axis of the orthographic projection (the width of the ortho projection).<br>
|
||||
---* param zoomY The zoom factor along the Y-axis of the orthographic projection (the height of the ortho projection).<br>
|
||||
---* param nearPlane The near plane distance.<br>
|
||||
---* param farPlane The far plane distance.
|
||||
---@param zoomX float
|
||||
---@param zoomY float
|
||||
---@param nearPlane float
|
||||
---@param farPlane float
|
||||
---@return self
|
||||
function Camera:createOrthographic (zoomX,zoomY,nearPlane,farPlane) end
|
||||
---* Get the visiting camera , the visiting camera shall be set on Scene::render
|
||||
---@return self
|
||||
function Camera:getVisitingCamera () end
|
||||
---* create default camera, the camera type depends on Director::getProjection, the depth of the default camera is 0
|
||||
---@return self
|
||||
function Camera:create () end
|
||||
---* Creates a perspective camera.<br>
|
||||
---* param fieldOfView The field of view for the perspective camera (normally in the range of 40-60 degrees).<br>
|
||||
---* param aspectRatio The aspect ratio of the camera (normally the width of the viewport divided by the height of the viewport).<br>
|
||||
---* param nearPlane The near plane distance.<br>
|
||||
---* param farPlane The far plane distance.
|
||||
---@param fieldOfView float
|
||||
---@param aspectRatio float
|
||||
---@param nearPlane float
|
||||
---@param farPlane float
|
||||
---@return self
|
||||
function Camera:createPerspective (fieldOfView,aspectRatio,nearPlane,farPlane) end
|
||||
---*
|
||||
---@return cc.Viewport
|
||||
function Camera:getDefaultViewport () end
|
||||
---*
|
||||
---@param vp cc.Viewport
|
||||
---@return self
|
||||
function Camera:setDefaultViewport (vp) end
|
||||
---* Get the default camera of the current running scene.
|
||||
---@return self
|
||||
function Camera:getDefaultCamera () end
|
||||
---*
|
||||
---@param renderer cc.Renderer
|
||||
---@param parentTransform mat4_table
|
||||
---@param parentFlags unsigned_int
|
||||
---@return self
|
||||
function Camera:visit (renderer,parentTransform,parentFlags) end
|
||||
---*
|
||||
---@return self
|
||||
function Camera:Camera () end
|
|
@ -1,59 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CameraBackgroundBrush :cc.Ref
|
||||
local CameraBackgroundBrush={ }
|
||||
cc.CameraBackgroundBrush=CameraBackgroundBrush
|
||||
|
||||
|
||||
|
||||
|
||||
---* get brush type<br>
|
||||
---* return BrushType
|
||||
---@return int
|
||||
function CameraBackgroundBrush:getBrushType () end
|
||||
---* draw the background
|
||||
---@param a cc.Camer
|
||||
---@return self
|
||||
function CameraBackgroundBrush:drawBackground (a) end
|
||||
---*
|
||||
---@return boolean
|
||||
function CameraBackgroundBrush:init () end
|
||||
---*
|
||||
---@return boolean
|
||||
function CameraBackgroundBrush:isValid () end
|
||||
---* Creates a Skybox brush with 6 textures.<br>
|
||||
---* param positive_x texture for the right side of the texture cube face.<br>
|
||||
---* param negative_x texture for the up side of the texture cube face.<br>
|
||||
---* param positive_y texture for the top side of the texture cube face<br>
|
||||
---* param negative_y texture for the bottom side of the texture cube face<br>
|
||||
---* param positive_z texture for the forward side of the texture cube face.<br>
|
||||
---* param negative_z texture for the rear side of the texture cube face.<br>
|
||||
---* return A new brush inited with given parameters.
|
||||
---@param positive_x string
|
||||
---@param negative_x string
|
||||
---@param positive_y string
|
||||
---@param negative_y string
|
||||
---@param positive_z string
|
||||
---@param negative_z string
|
||||
---@return cc.CameraBackgroundSkyBoxBrush
|
||||
function CameraBackgroundBrush:createSkyboxBrush (positive_x,negative_x,positive_y,negative_y,positive_z,negative_z) end
|
||||
---* Creates a color brush<br>
|
||||
---* param color Color of brush<br>
|
||||
---* param depth Depth used to clear depth buffer<br>
|
||||
---* return Created brush
|
||||
---@param color color4f_table
|
||||
---@param depth float
|
||||
---@return cc.CameraBackgroundColorBrush
|
||||
function CameraBackgroundBrush:createColorBrush (color,depth) end
|
||||
---* Creates a none brush, it does nothing when clear the background<br>
|
||||
---* return Created brush.
|
||||
---@return self
|
||||
function CameraBackgroundBrush:createNoneBrush () end
|
||||
---* Creates a depth brush, which clears depth buffer with a given depth.<br>
|
||||
---* param depth Depth used to clear depth buffer<br>
|
||||
---* return Created brush
|
||||
---@return cc.CameraBackgroundDepthBrush
|
||||
function CameraBackgroundBrush:createDepthBrush () end
|
||||
---*
|
||||
---@return self
|
||||
function CameraBackgroundBrush:CameraBackgroundBrush () end
|
|
@ -1,36 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CameraBackgroundColorBrush :cc.CameraBackgroundDepthBrush
|
||||
local CameraBackgroundColorBrush={ }
|
||||
cc.CameraBackgroundColorBrush=CameraBackgroundColorBrush
|
||||
|
||||
|
||||
|
||||
|
||||
---* Set clear color<br>
|
||||
---* param color Color used to clear the color buffer
|
||||
---@param color color4f_table
|
||||
---@return self
|
||||
function CameraBackgroundColorBrush:setColor (color) end
|
||||
---* Create a color brush<br>
|
||||
---* param color Color used to clear the color buffer<br>
|
||||
---* param depth Depth used to clear the depth buffer<br>
|
||||
---* return Created brush
|
||||
---@param color color4f_table
|
||||
---@param depth float
|
||||
---@return self
|
||||
function CameraBackgroundColorBrush:create (color,depth) end
|
||||
---* Get brush type. Should be BrushType::COLOR<br>
|
||||
---* return brush type
|
||||
---@return int
|
||||
function CameraBackgroundColorBrush:getBrushType () end
|
||||
---* Draw background
|
||||
---@param camera cc.Camera
|
||||
---@return self
|
||||
function CameraBackgroundColorBrush:drawBackground (camera) end
|
||||
---*
|
||||
---@return boolean
|
||||
function CameraBackgroundColorBrush:init () end
|
||||
---*
|
||||
---@return self
|
||||
function CameraBackgroundColorBrush:CameraBackgroundColorBrush () end
|
|
@ -1,34 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CameraBackgroundDepthBrush :cc.CameraBackgroundBrush
|
||||
local CameraBackgroundDepthBrush={ }
|
||||
cc.CameraBackgroundDepthBrush=CameraBackgroundDepthBrush
|
||||
|
||||
|
||||
|
||||
|
||||
---* Set depth<br>
|
||||
---* param depth Depth used to clear depth buffer
|
||||
---@param depth float
|
||||
---@return self
|
||||
function CameraBackgroundDepthBrush:setDepth (depth) end
|
||||
---* Create a depth brush<br>
|
||||
---* param depth Depth used to clear the depth buffer<br>
|
||||
---* return Created brush
|
||||
---@param depth float
|
||||
---@return self
|
||||
function CameraBackgroundDepthBrush:create (depth) end
|
||||
---* Get brush type. Should be BrushType::DEPTH<br>
|
||||
---* return brush type
|
||||
---@return int
|
||||
function CameraBackgroundDepthBrush:getBrushType () end
|
||||
---* Draw background
|
||||
---@param camera cc.Camera
|
||||
---@return self
|
||||
function CameraBackgroundDepthBrush:drawBackground (camera) end
|
||||
---*
|
||||
---@return boolean
|
||||
function CameraBackgroundDepthBrush:init () end
|
||||
---*
|
||||
---@return self
|
||||
function CameraBackgroundDepthBrush:CameraBackgroundDepthBrush () end
|
|
@ -1,52 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CameraBackgroundSkyBoxBrush :cc.CameraBackgroundBrush
|
||||
local CameraBackgroundSkyBoxBrush={ }
|
||||
cc.CameraBackgroundSkyBoxBrush=CameraBackgroundSkyBoxBrush
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param valid boolean
|
||||
---@return self
|
||||
function CameraBackgroundSkyBoxBrush:setTextureValid (valid) end
|
||||
---* Set skybox texture <br>
|
||||
---* param texture Skybox texture
|
||||
---@param texture cc.TextureCube
|
||||
---@return self
|
||||
function CameraBackgroundSkyBoxBrush:setTexture (texture) end
|
||||
---*
|
||||
---@param actived boolean
|
||||
---@return self
|
||||
function CameraBackgroundSkyBoxBrush:setActived (actived) end
|
||||
---*
|
||||
---@return boolean
|
||||
function CameraBackgroundSkyBoxBrush:isActived () end
|
||||
---@overload fun():self
|
||||
---@overload fun(string:string,string:string,string:string,string:string,string:string,string:string):self
|
||||
---@param positive_x string
|
||||
---@param negative_x string
|
||||
---@param positive_y string
|
||||
---@param negative_y string
|
||||
---@param positive_z string
|
||||
---@param negative_z string
|
||||
---@return self
|
||||
function CameraBackgroundSkyBoxBrush:create (positive_x,negative_x,positive_y,negative_y,positive_z,negative_z) end
|
||||
---* Get brush type. Should be BrushType::SKYBOX<br>
|
||||
---* return brush type
|
||||
---@return int
|
||||
function CameraBackgroundSkyBoxBrush:getBrushType () end
|
||||
---* Draw background
|
||||
---@param camera cc.Camera
|
||||
---@return self
|
||||
function CameraBackgroundSkyBoxBrush:drawBackground (camera) end
|
||||
---* init Skybox.
|
||||
---@return boolean
|
||||
function CameraBackgroundSkyBoxBrush:init () end
|
||||
---*
|
||||
---@return boolean
|
||||
function CameraBackgroundSkyBoxBrush:isValid () end
|
||||
---*
|
||||
---@return self
|
||||
function CameraBackgroundSkyBoxBrush:CameraBackgroundSkyBoxBrush () end
|
|
@ -1,26 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CardinalSplineBy :cc.CardinalSplineTo
|
||||
local CardinalSplineBy={ }
|
||||
cc.CardinalSplineBy=CardinalSplineBy
|
||||
|
||||
|
||||
|
||||
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function CardinalSplineBy:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function CardinalSplineBy:clone () end
|
||||
---*
|
||||
---@param newPos vec2_table
|
||||
---@return self
|
||||
function CardinalSplineBy:updatePosition (newPos) end
|
||||
---*
|
||||
---@return self
|
||||
function CardinalSplineBy:reverse () end
|
||||
---*
|
||||
---@return self
|
||||
function CardinalSplineBy:CardinalSplineBy () end
|
|
@ -1,45 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CardinalSplineTo :cc.ActionInterval
|
||||
local CardinalSplineTo={ }
|
||||
cc.CardinalSplineTo=CardinalSplineTo
|
||||
|
||||
|
||||
|
||||
|
||||
---* Return a PointArray.<br>
|
||||
---* return A PointArray.
|
||||
---@return point_table
|
||||
function CardinalSplineTo:getPoints () end
|
||||
---* It will update the target position and change the _previousPosition to newPos<br>
|
||||
---* param newPos The new position.
|
||||
---@param newPos vec2_table
|
||||
---@return self
|
||||
function CardinalSplineTo:updatePosition (newPos) end
|
||||
---* Initializes the action with a duration and an array of points.<br>
|
||||
---* param duration In seconds.<br>
|
||||
---* param points An PointArray.<br>
|
||||
---* param tension Goodness of fit.
|
||||
---@param duration float
|
||||
---@param points point_table
|
||||
---@param tension float
|
||||
---@return boolean
|
||||
function CardinalSplineTo:initWithDuration (duration,points,tension) end
|
||||
---*
|
||||
---@param target cc.Node
|
||||
---@return self
|
||||
function CardinalSplineTo:startWithTarget (target) end
|
||||
---*
|
||||
---@return self
|
||||
function CardinalSplineTo:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function CardinalSplineTo:reverse () end
|
||||
---* param time In seconds.
|
||||
---@param time float
|
||||
---@return self
|
||||
function CardinalSplineTo:update (time) end
|
||||
---* js ctor<br>
|
||||
---* lua NA
|
||||
---@return self
|
||||
function CardinalSplineTo:CardinalSplineTo () end
|
|
@ -1,22 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CatmullRomBy :cc.CardinalSplineBy
|
||||
local CatmullRomBy={ }
|
||||
cc.CatmullRomBy=CatmullRomBy
|
||||
|
||||
|
||||
|
||||
|
||||
---* Initializes the action with a duration and an array of points.<br>
|
||||
---* param dt In seconds.<br>
|
||||
---* param points An PointArray.
|
||||
---@param dt float
|
||||
---@param points point_table
|
||||
---@return boolean
|
||||
function CatmullRomBy:initWithDuration (dt,points) end
|
||||
---*
|
||||
---@return self
|
||||
function CatmullRomBy:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function CatmullRomBy:reverse () end
|
|
@ -1,22 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.CatmullRomTo :cc.CardinalSplineTo
|
||||
local CatmullRomTo={ }
|
||||
cc.CatmullRomTo=CatmullRomTo
|
||||
|
||||
|
||||
|
||||
|
||||
---* Initializes the action with a duration and an array of points.<br>
|
||||
---* param dt In seconds.<br>
|
||||
---* param points An PointArray.
|
||||
---@param dt float
|
||||
---@param points point_table
|
||||
---@return boolean
|
||||
function CatmullRomTo:initWithDuration (dt,points) end
|
||||
---*
|
||||
---@return self
|
||||
function CatmullRomTo:clone () end
|
||||
---*
|
||||
---@return self
|
||||
function CatmullRomTo:reverse () end
|
|
@ -1,77 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ClippingNode :cc.Node
|
||||
local ClippingNode={ }
|
||||
cc.ClippingNode=ClippingNode
|
||||
|
||||
|
||||
|
||||
|
||||
---* If stencil has no children it will not be drawn.<br>
|
||||
---* If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
|
||||
---* then this method should return true every time you wish stencil to be visited.<br>
|
||||
---* By default returns true if has any children attached.<br>
|
||||
---* return If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
|
||||
---* then this method should return true every time you wish stencil to be visited.<br>
|
||||
---* By default returns true if has any children attached.<br>
|
||||
---* js NA
|
||||
---@return boolean
|
||||
function ClippingNode:hasContent () end
|
||||
---* Set the ClippingNode whether or not invert.<br>
|
||||
---* param inverted A bool Type,to set the ClippingNode whether or not invert.
|
||||
---@param inverted boolean
|
||||
---@return self
|
||||
function ClippingNode:setInverted (inverted) end
|
||||
---* Set the Node to use as a stencil to do the clipping.<br>
|
||||
---* param stencil The Node to use as a stencil to do the clipping.
|
||||
---@param stencil cc.Node
|
||||
---@return self
|
||||
function ClippingNode:setStencil (stencil) end
|
||||
---* The alpha threshold.<br>
|
||||
---* The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.<br>
|
||||
---* Should be a float between 0 and 1.<br>
|
||||
---* This default to 1 (so alpha test is disabled).<br>
|
||||
---* return The alpha threshold value,Should be a float between 0 and 1.
|
||||
---@return float
|
||||
function ClippingNode:getAlphaThreshold () end
|
||||
---* Initializes a clipping node with an other node as its stencil.<br>
|
||||
---* The stencil node will be retained, and its parent will be set to this clipping node.
|
||||
---@param stencil cc.Node
|
||||
---@return boolean
|
||||
function ClippingNode:init (stencil) end
|
||||
---* The Node to use as a stencil to do the clipping.<br>
|
||||
---* The stencil node will be retained.<br>
|
||||
---* This default to nil.<br>
|
||||
---* return The stencil node.
|
||||
---@return cc.Node
|
||||
function ClippingNode:getStencil () end
|
||||
---* Set the alpha threshold. <br>
|
||||
---* param alphaThreshold The alpha threshold.
|
||||
---@param alphaThreshold float
|
||||
---@return self
|
||||
function ClippingNode:setAlphaThreshold (alphaThreshold) end
|
||||
---* Inverted. If this is set to true,<br>
|
||||
---* the stencil is inverted, so the content is drawn where the stencil is NOT drawn.<br>
|
||||
---* This default to false.<br>
|
||||
---* return If the clippingNode is Inverted, it will be return true.
|
||||
---@return boolean
|
||||
function ClippingNode:isInverted () end
|
||||
---@overload fun(cc.Node:cc.Node):self
|
||||
---@overload fun():self
|
||||
---@param stencil cc.Node
|
||||
---@return self
|
||||
function ClippingNode:create (stencil) end
|
||||
---*
|
||||
---@param mask unsigned short
|
||||
---@param applyChildren boolean
|
||||
---@return self
|
||||
function ClippingNode:setCameraMask (mask,applyChildren) end
|
||||
---*
|
||||
---@param renderer cc.Renderer
|
||||
---@param parentTransform mat4_table
|
||||
---@param parentFlags unsigned_int
|
||||
---@return self
|
||||
function ClippingNode:visit (renderer,parentTransform,parentFlags) end
|
||||
---* Initializes a clipping node without a stencil.
|
||||
---@return boolean
|
||||
function ClippingNode:init () end
|
|
@ -1,38 +0,0 @@
|
|||
---@meta
|
||||
|
||||
---@class cc.ClippingRectangleNode :cc.Node
|
||||
local ClippingRectangleNode={ }
|
||||
cc.ClippingRectangleNode=ClippingRectangleNode
|
||||
|
||||
|
||||
|
||||
|
||||
---* brief Get whether the clipping is enabled or not.<br>
|
||||
---* return Whether the clipping is enabled or not. Default is true.
|
||||
---@return boolean
|
||||
function ClippingRectangleNode:isClippingEnabled () end
|
||||
---* brief Enable/Disable the clipping.<br>
|
||||
---* param enabled Pass true to enable clipping. Pass false to disable clipping.
|
||||
---@param enabled boolean
|
||||
---@return self
|
||||
function ClippingRectangleNode:setClippingEnabled (enabled) end
|
||||
---* brief Get the clipping rectangle.<br>
|
||||
---* return The clipping rectangle.
|
||||
---@return rect_table
|
||||
function ClippingRectangleNode:getClippingRegion () end
|
||||
---* brief Set the clipping rectangle.<br>
|
||||
---* param clippingRegion Specify the clipping rectangle.
|
||||
---@param clippingRegion rect_table
|
||||
---@return self
|
||||
function ClippingRectangleNode:setClippingRegion (clippingRegion) end
|
||||
---@overload fun():self
|
||||
---@overload fun(rect_table:rect_table):self
|
||||
---@param clippingRegion rect_table
|
||||
---@return self
|
||||
function ClippingRectangleNode:create (clippingRegion) end
|
||||
---*
|
||||
---@param renderer cc.Renderer
|
||||
---@param parentTransform mat4_table
|
||||
---@param parentFlags unsigned_int
|
||||
---@return self
|
||||
function ClippingRectangleNode:visit (renderer,parentTransform,parentFlags) end
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue