We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如下这样的一个sample,这样在一些带lsp的编辑器中就可以实现编辑的时候的代码提示和自动补全功能
---------------------------------------------------------------- ---@class KeyEventReg ---@field modifier number modifier of KeyEventReg ---@field keycode number keycode of KeyEventReg KeyEventReg = { } _KeyEventReg = { } _KeyEventReg.kShiftMask = (1<<0) _KeyEventReg.kLockMask = (1<<1) _KeyEventReg.kCtrlMask = (1<<2) _KeyEventReg.kMod1Mask = (1<<3) _KeyEventReg.kAltMask = (1<<3) _KeyEventReg.kMod2Mask = (1<<4) _KeyEventReg.kMod3Mask = (1<<5) _KeyEventReg.kMod4Mask = (1<<6) _KeyEventReg.kMod5Mask = (1<<7) _KeyEventReg.kReleaseMask = (1<<30) _KeyEventReg.kSuperMask = (1<<26) _KeyEventReg.kHyperMask = (1<<27) _KeyEventReg.kMetaMask = (1<<28) _KeyEventReg.kModifierMask = 0x5f001fff ---@func fun(): string ---key info for human being ---binding of rime::KeyEvent::repr() ---@return string function KeyEventReg:repr() -- not actually fullfield here return "" end ---@func fun(): boolean ---check if it's shifted ---binding of rime::KeyEvent::shift() ---@return boolean function KeyEventReg:shift() return (self.modifier & _KeyEventReg.kShiftMask) end ---check if it's released ---binding of rime::KeyEvent::release() ---@func fun(): boolean ---@return boolean function KeyEventReg:release() return (self.modifier & _KeyEventReg.kReleaseMask) end ---@func fun(): boolean ---check if it's ctrled ---binding of rime::KeyEvent::ctrl() ---@return boolean function KeyEventReg:ctrl() return (self.modifier & _KeyEventReg.kCtrlMask) end ---@func fun(): boolean ---check if it's capslocked ---binding of rime::KeyEvent::caps() ---@return boolean function KeyEventReg:caps() return (self.modifier & _KeyEventReg.kLockMask) end ---@func fun(): boolean ---check if it's supered ---binding of rime::KeyEvent::super() ---@return boolean function KeyEventReg:super() return (self.modifier & _KeyEventReg.kSuperMask) end ---@func fun(): boolean ---check if it's alted ---binding of rime::KeyEvent::alt() ---@return boolean function KeyEventReg:alt() return (self.modifier & _KeyEventReg.kAltMask) end ---@func fun(): boolean ---@param key KeyEventReg ---check if is == key ---binding of rime::KeyEvent::operator== ---@return boolean function KeyEventReg:eq(key) return self.keycode == key.keycode and self.modifier == key.modifier end ---@func fun(): boolean ---@param key KeyEventReg ---check if is < key ---binding of rime::KeyEvent::operator< ---@return boolean function KeyEventReg:lt(key) if not self:eq(key) then return self.keycode < key.keycode else return self.modifier < key.modifier end end ---@param arg1 string | number ---@param ... nil | number ---@return KeyEventReg | nil ---Create a KeyEventReg by KeyEvent(repr) or KeyEvent(keycode, modifier) function KeyEvent(arg1, ...) end
The text was updated successfully, but these errors were encountered:
可能可以新建一个 contrib 目录,用于收集类似的辅助开发配置和纯 lua 层面的开发框架?
Sorry, something went wrong.
@hchunhui 作者大大好,我在 @lost-melody 的工作的基础上做了一份完整的定义文件,可以被 vscode 等编辑器中的 lua language server 识别,目前发布在 GitHub Gists 上:
https://gist.github.com/tansongchen/d4ed4fc4886d2ddee60dc5403c5005f4
如有需要,也可以合并进本仓库
No branches or pull requests
如下这样的一个sample,这样在一些带lsp的编辑器中就可以实现编辑的时候的代码提示和自动补全功能
The text was updated successfully, but these errors were encountered: