L2U AutoComplete
auto complete plugin for sublime text 2/3 which is used in HRG-LME
Details
Installs
- Total 8K
- Win 6K
- Mac 1K
- Linux 824
Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
Mac | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Description
L2U-AutoComplete is a package for Sublime Text 2/3 with support for the L2U API for HRG-LME. It is based on SublimeLove
Installation
You can install this package through Package Control, simply use Command Palette: Package Control Install Package -> L2U-AutoComplete.
Alternatively, you can install this package by running the following command in your Packages directory:
git clone git://github.com/sNaticY/L2U-AutoComplete
Auto completion
AssetLoader,L2U 以及 game_object_utils 常用函数的自动补全
常用函数是指在项目的lua代码中经常被调用的一些函数,去除如 L2U.SetGameObjectLocalPosition() 之类的已经在 game_object_utils 中重新封装的函数,避免大家越过 game_object_utils 直接调用,以及去除应用场景较为狭窄的函数,如 ConnectToHost 等普通业务逻辑无需用到的函数,以保持函数列表的整洁,从此以后输入一些关键词即可自动出现列表提供选择
输入 find
L2U.FindGameObject
L2U.FindGameObjectAsComponent
提供可选参数特殊标识功能,如此处选择第一个则自动补全以下字符
L2U.FindGameObject( goName, parentGO:1, mustExist:2 )
通过TAB键可自动选中下一个参数直接修改即可,齐王上次提到的多态问题,通过可选参数后的数字来标识,如以上示例,parentGO和mustExist都为可选参数,对应以下三种实现
public static GameObject FindGameObject( string goName )
public static GameObject FindGameObject( string goName, GameObject parentGO )
public static GameObject FindGameObject( string goName, GameObject parentGO, bool mustExist )
每个函数只在函数列表中出现一次,大幅度提高在不知道函数名的情况下仅靠关键词来筛选的效率。
Snippets
There are snippets for most built-in Lua functions, some LuaJIT functions, and LuaDoc tags are available in comments. For example. “@param” expands to “– @param type name desc”.
原代码风格已修改至符合LME内部代码风格,修改前: “lua for i,v in ipairs(table_name) do print(i,v) end
修改后:
```lua
for i, v in ipairs( table_name ) do
print( i, v )
end
Error checking
By default any Lua file will be run through luac -p and the first encountered error is outlined. The error is displayed in the status bar.
To disable or change this behavior
{
"live_parser": true,
"live_parser_style": "{dot|circle|outline}",
"live_parser_persistent:" false,
"luac_path": "luac"
}
Auto completion
Pressing Ctrl+Space in an open Lua file will show the autocompletions for the L2U & gameObject-utils API as well as Lua function snippets.
Those L2U & gameObject-utils functions which are not overloaded (only one possible argument combination), will fill in the argument names for you.