Sublime 3包自定义自动完成

时间:2017-02-23 20:28:05

标签: lua sublimetext3

嘿,我正在努力让这个软件包正常工作,所以我可以使用自定义lua自动完成这个我正在尝试使用的API。

{
"scope": "source.lua",

"completions":
[
    "GOS_DIR",
    "SCRIPT_PATH",
    "COMMON_PATH",
    "SPRITE_PATH",
    "SOUNDS_PATH",
    "FONTS_PATH",
    "myHero",

    {"trigger": "GetTickCount\t TickCount ofc (ms)", "contents": "GetTickCount()"},
    {"trigger": "GetImageInfoFromFile\t (file_path)", "contents": "GetImageInfoFromFile(${1:file_path})"},
    {"trigger": "DumpDocumentation\t create GoSExt API (file)", "contents": "DumpDocumentation(${1:\"API.lua\"})"},

    {"trigger": "Callback.Add\t(\"type\", func) -- return callbackID", "contents": "Callback.Add(\"${1:Load}\", function($2)\n\t$3\nend)"},
    {"trigger": "Callback.Del\t(\"type\", callbackID)"},
    {"trigger": "OnLoad\tcb.function()", "contents": "Callback.Add(\"Load\", function()\n\t$1\nend)"},
    {"trigger": "UnLoad\tcb.function()", "contents": "Callback.Add(\"UnLoad\", function()\n\t$1\nend)"},
    {"trigger": "OnGameEnd\tcb.function()", "contents": "Callback.Add(\"GameEnd\", function()\n\t$1\nend)"},
    {"trigger": "OnTick\tcb.function()", "contents": "Callback.Add(\"Tick\", function()\n\t$1\nend)"},
    {"trigger": "OnDraw\tcb.function()", "contents": "Callback.Add(\"Draw\", function()\n\t$1\nend)"},
    {"trigger": "OnWndMsg\tcb.function(msg, wParam)", "contents": "Callback.Add(\"WndMsg\", function(msg, wParam)\n\t$1\nend)"},
    {"trigger": "OnProcessRecall\tcb.function(hero, recalProc)", "contents": "Callback.Add(\"ProcessRecall\", function(hero, recalProc)\n\t$1\nend)"},

    {"trigger": "PrintChat\t(string)", "contents": "PrintChat(\"${1:string}\")"},
    {"trigger": "print\t(vec/string/num/table)", "contents": "print(${1:Vector/string/number/table})"},
    {"trigger": "DownloadFileAsync\t(\"link\", savePath, callback)", "contents": "DownloadFileAsync(\"${1:link}\", ${2:SCRIPT_PATH}..\"${3:File'name}.lua\", function() $4 end)"},
    {"trigger": "GetWebResultAsync\t(\"link\", callback(\"string\"))", "contents": "GetWebResultAsync(\"${1:link}\", function(str) \n\t$2\nend)"},

    {"trigger": "WM_MOUSEHWHEEL\\tOnWndMsg(param1, wParam)", "contents": "WM_MOUSEHWHEEL"},
    {"trigger": "WM_MBUTTONUP\\tOnWndMsg(param1, wParam)", "contents": "WM_MBUTTONUP"},
    {"trigger": "WM_MBUTTONDOWN\\tOnWndMsg(param1, wParam)", "contents": "WM_MBUTTONDOWN"},
    {"trigger": "WM_RBUTTONUP\\tOnWndMsg(param1, wParam)", "contents": "WM_RBUTTONUP"},
    {"trigger": "WM_RBUTTONDOWN\\tOnWndMsg(param1, wParam)", "contents": "WM_RBUTTONDOWN"},
    {"trigger": "WM_LBUTTONUP\\tOnWndMsg(param1, wParam)", "contents": "WM_LBUTTONUP"},
    {"trigger": "WM_LBUTTONDOWN\\tOnWndMsg(param1, wParam)", "contents": "WM_LBUTTONDOWN"},
    {"trigger": "KEY_UP\\tOnWndMsg(param1, wParam)", "contents": "KEY_UP"},
    {"trigger": "KEY_DOWN\\tOnWndMsg(param1, wParam)", "contents": "KEY_DOWN"},

    {"trigger": "STATE_UNKNOWN\\t useFor unit.attackData.stage", "contents": "STATE_UNKNOWN"},
    {"trigger": "STATE_ATTACK\\t useFor unit.attackData.stage", "contents": "STATE_ATTACK"},
    {"trigger": "STATE_WINDUP\\t useFor unit.attackData.stage", "contents": "STATE_WINDUP"},
    {"trigger": "STATE_WINDDOWN\\t useFor unit.attackData.stage", "contents": "STATE_WINDDOWN"},

    "_Q",
    "_W",
    "_E",
    "_R",
    "ITEM_1",
    "ITEM_2",
    "ITEM_3",
    "ITEM_4",
    "ITEM_5", 
    "ITEM_6", 
    "ITEM_7",
    "SUMMONER_1",
    "SUMMONER_2",

    "HK_Q",
    "HK_W",
    "HK_E",
    "HK_R",
    "HK_ITEM_1",
    "HK_ITEM_2",
    "HK_ITEM_3",
    "HK_ITEM_4",
    "HK_ITEM_5",
    "HK_ITEM_6",
    "HK_ITEM_7",
    "HK_SUMMONER_1",
    "HK_SUMMONER_2",
    {"trigger": "HK_TCO\tTarget Champions Only", "contents": "HK_TCO"},
    {"trigger": "HK_LUS\tLevel Up Spell Hotkey", "contents": "HK_LUS"},

    {"trigger": "MOUSEEVENTF_LEFTDOWN\tmouse_event(MOUSEEVENTF_LEFTDOWN)", "contents": "MOUSEEVENTF_LEFTDOWN"},
    {"trigger": "MOUSEEVENTF_LEFTUP\tmouse_event(MOUSEEVENTF_LEFTUP)", "contents": "MOUSEEVENTF_LEFTUP"},
    {"trigger": "MOUSEEVENTF_RIGHTDOWN\tmouse_event(MOUSEEVENTF_RIGHTDOWN)", "contents": "MOUSEEVENTF_RIGHTDOWN"},
    {"trigger": "MOUSEEVENTF_RIGHTUP\tmouse_event(MOUSEEVENTF_RIGHTUP)", "contents": "MOUSEEVENTF_RIGHTUP"},

    "CRYSTAL_SCAR",
    "TWISTED_TREELINE",
    "SUMMONERS_RIFT",
    "HOWLING_ABYSS",

    {"trigger": "Obj_AI_SpawnPoint\t\"obj_SpawnPoint\"", "contents": "Obj_AI_SpawnPoint"},
    {"trigger": "Obj_AI_Camp\t\"NeutralMinionCamp\"", "contents": "Obj_AI_Camp"},
    {"trigger": "Obj_AI_Barracks\t\"obj_BarracksDampener\"", "contents": "Obj_AI_Barracks"},
    {"trigger": "Obj_AI_Hero\t\"AIHeroClient\"", "contents": "Obj_AI_Hero"},
    {"trigger": "Obj_AI_Minion\t\"obj_AI_Minion\"", "contents": "Obj_AI_Minion"},
    {"trigger": "Obj_AI_Turret\t\"obj_AI_Turret\"", "contents": "Obj_AI_Turret"},
    {"trigger": "Obj_AI_LineMissle\t\"MissileClient\"", "contents": "Obj_AI_LineMissle"},
    {"trigger": "Obj_AI_Shop\t\"obj_Shop\"", "contents": "Obj_AI_Shop"},

    {"trigger": "cursorPos\tVector2D(x, y)", "contents": "cursorPos"},
    {"trigger": "mousePos\tVector3D(x, y, z)", "contents": "mousePos"},

    {"trigger": "networkID\tobj.", "contents": "networkID"},    
    {"trigger": "handle\tobj. -- Missile owner/target check", "contents": "handle"},    
    {"trigger": "chnd\tcamp. -- Camp handle", "contents": "chnd"},  
    {"trigger": "buffCount\tobj.", "contents": "buffCount"},    
    {"trigger": "isMe\tobj.", "contents": "isMe"},  
    {"trigger": "isAlly\tobj.", "contents": "isAlly"},  
    {"trigger": "isEnemy\tobj.", "contents": "isEnemy"},    
    {"trigger": "team\tobj.", "contents": "team"},  
    {"trigger": "owner\tobj.", "contents": "owner"},    
    {"trigger": "targetID\tobj. -- TurrentTarget", "contents": "targetID"}, 
    {"trigger": "type\tobj. -- string", "contents": "type"},    
    {"trigger": "name\t[obj/spell/buff].", "contents": "name"}, 
    {"trigger": "charName\tobj.", "contents": "charName"},  
    {"trigger": "health\tobj.", "contents": "health"},  
    {"trigger": "maxHealth\tobj.", "contents": "maxHealth"},    
    {"trigger": "mana\tobj.", "contents": "mana"},  
    {"trigger": "maxMana\tobj.", "contents": "maxMana"},    
    {"trigger": "shieldAD\tobj.", "contents": "shieldAD"},  
    {"trigger": "shieldAP\tobj.", "contents": "shieldAP"},  
    {"trigger": "cdr\tobj.", "contents": "cdr"},    
    {"trigger": "armorPen\tobj.", "contents": "armorPen"},  
    {"trigger": "armorPenPercent\tobj.", "contents": "armorPenPercent"},    
    {"trigger": "bonusArmorPenPercent\tobj.", "contents": "bonusArmorPenPercent"},  
    {"trigger": "magicPen\tobj.", "contents": "magicPen"},  
    {"trigger": "magicPenPercent\tobj.", "contents": "magicPenPercent"},    
    {"trigger": "baseDamage\tobj. --  adDmg", "contents": "baseDamage"},    
    {"trigger": "bonusDamage\tobj. --  adDmg", "contents": "bonusDamage"},  
    {"trigger": "totalDamage\tobj. --  base+bonus adDmg", "contents": "totalDamage"},   
    {"trigger": "ap\tobj. --  apDmg", "contents": "ap"},    
    {"trigger": "lifeSteal\tobj.", "contents": "lifeSteal"},    
    {"trigger": "spellVamp\tobj.", "contents": "spellVamp"},    
    {"trigger": "attackSpeed\tobj.", "contents": "attackSpeed"},    
    {"trigger": "critChance\tobj.", "contents": "critChance"},  
    {"trigger": "armor\tobj.", "contents": "armor"},    
    {"trigger": "bonusArmor\tobj.", "contents": "bonusArmor"},  
    {"trigger": "magicResist\tobj.", "contents": "magicResist"},    
    {"trigger": "bonusMagicResist\tobj.", "contents": "bonusMagicResist"},  
    {"trigger": "hpRegen\tobj.", "contents": "hpRegen"},    
    {"trigger": "mpRegen\tobj.", "contents": "mpRegen"},    
    {"trigger": "ms\tobj.", "contents": "ms"},  
    {"trigger": "range\tobj.", "contents": "range"},    
    {"trigger": "boundingRadius\tobj. -- GetHitBox", "contents": "boundingRadius"}, 
    {"trigger": "gold\tobj.", "contents": "gold"},  
    {"trigger": "totalGold\tobj.", "contents": "totalGold"},    
    {"trigger": "dead\tobj.", "contents": "dead"},  
    {"trigger": "visible\tobj.", "contents": "visible"},    
    {"trigger": "isTargetable\tobj.", "contents": "isTargetable"},  
    {"trigger": "distance\tobj. --  obj:DistanceTo(myHero.pos)", "contents": "distance"},   
    {"trigger": "pos\tobj.", "contents": "pos"},    
    {"trigger": "posTo\tobj.", "contents": "posTo"},    
    {"trigger": "pos2D\tobj.", "contents": "pos2D"},    
    {"trigger": "posMM\tobj. -- pos Minimap", "contents": "posMM"}, 
    {"trigger": "dir\tobj. -- GetDirection(obj)", "contents": "dir"},   
    {"trigger": "isCampUp\tcamp.", "contents": "isCampUp"}, 
    {"trigger": "valid\tunit.", "contents": "valid"},   
    {"trigger": "exp\tobj.", "contents": "exp"},    
    {"trigger": "bonusDamagePercent\tobj.", "contents": "bonusDamagePercent"},  
    {"trigger": "flatDamageReduction\tobj.", "contents": "flatDamageReduction"},

    {"trigger": "levelData\thero.levelData", "contents": "levelData"},
    {"trigger": "lvl\thero.levelData.lvl", "contents": "lvl"},
    {"trigger": "lvlPts\thero.levelData.lvlPts", "contents": "lvlPts"},

    {"trigger": "missileData\tmissile.missileData", "contents": "missileData"},
    {"trigger": "target\t[missileData/attackData].target", "contents": "target"},
    {"trigger": "startPos\tmissileData.startPos", "contents": "startPos"},
    {"trigger": "endPos\tmissileData.endPos", "contents": "endPos"},
    {"trigger": "placementPos\tmissileData.placementPos", "contents": "placementPos"},
    {"trigger": "range\t[missileData/:GetSpellData(s)].range", "contents": "range"},
    {"trigger": "delay\tmissileData.delay", "contents": "delay"},
    {"trigger": "speed\t[missileData/:GetSpellData(s)].speed", "contents": "speed"},
    {"trigger": "width\t[missileData/:GetSpellData(s)].width", "contents": "width"},
    {"trigger": "manaCost\t[missileData/spell].manaCost", "contents": "manaCost"},

    {"trigger": "attackData\tunit.attackData", "contents": "attackData"},
    {"trigger": "state\tattackData.", "contents": "state"},
    {"trigger": "windUpTime\tattackData.", "contents": "windUpTime"},
    {"trigger": "windDownTime\tattackData.", "contents": "windDownTime"},
    {"trigger": "animationTime\tattackData.", "contents": "animationTime"},
    {"trigger": "endTime\tattackData.", "contents": "endTime"},
    {"trigger": "castFrame\tattackData.", "contents": "castFrame"},
    {"trigger": "projectileSpeed\tattackData.", "contents": "projectileSpeed"},

    {"trigger": "GetSpellData\thero:GetSpellData(spell)", "contents": "GetSpellData(${1:spell})"},
    {"trigger": "level\thero:GetSpellData(spell).", "contents": "level"},
    {"trigger": "castTime\thero:GetSpellData(spell).", "contents": "castTime"},
    {"trigger": "cd\thero:GetSpellData(spell).", "contents": "cd"},
    {"trigger": "currentCd\thero:GetSpellData(spell).", "contents": "currentCd"},
    {"trigger": "ammo\t:[GetSpellData(s)/GetItemData(i)].", "contents": "ammo"},
    {"trigger": "ammoTime\thero:GetSpellData(spell).", "contents": "ammoTime"},
    {"trigger": "ammoCd\thero:GetSpellData(spell).", "contents": "ammoCd"},
    {"trigger": "ammoCurrentCd\thero:GetSpellData(spell).", "contents": "ammoCurrentCd"},
    {"trigger": "toggleState\thero:GetSpellData(spell).", "contents": "toggleState"},
    {"trigger": "targetingType\thero:GetSpellData(spell).", "contents": "targetingType"},
    {"trigger": "coneAngle\t:GetSpellData()", "contents": "coneAngle"},
    {"trigger": "coneDistance\thero:GetSpellData(spell).", "contents": "coneDistance"},
    {"trigger": "acceleration\thero:GetSpellData(spell).", "contents": "acceleration"},
    {"trigger": "castFrame\thero:GetSpellData(spell).", "contents": "castFrame"},
    {"trigger": "maxSpeed\thero:GetSpellData(spell).", "contents": "maxSpeed"},
    {"trigger": "minSpeed\thero:GetSpellData(spell).", "contents": "minSpeed"},

    {"trigger": "GetItemData\thero:GetItemData(index)", "contents": "GetItemData(${1:index})"},
    {"trigger": "itemID\thero:GetItemData(index).", "contents": "itemID"},
    {"trigger": "stacks\t:[GetItemData(i)/GetBuff(i)].", "contents": "stacks"},

    {"trigger": "GetBuff\tunit:GetBuff(index)", "contents": "GetBuff(${1:index})"},
    {"trigger": "type\tunit:GetBuff(index). -- [0->31]", "contents": "type"},
    {"trigger": "startTime\tunit:GetBuff(index). -- Game.Timer()", "contents": "startTime"},
    {"trigger": "expireTime\tunit:GetBuff(index). -- Game.Timer()", "contents": "expireTime"},
    {"trigger": "duration\tunit:GetBuff(index). -- Game.Timer() - startTime", "contents": "duration"},
    {"trigger": "count\tunit:GetBuff(index). -- number > 0 if valid", "contents": "count"},
    {"trigger": "sourcenID\tunit:GetBuff(index). buffSource.networkID", "contents": "sourcenID"},
    {"trigger": "sourceName\tunit:GetBuff(index). -- buffSource.charName", "contents": "sourceName"},

    {"trigger": "GetPrediction\t target:GetPrediction(speed, delay)", "contents": "GetPrediction(${1:speed}, ${2:delay})"},
    {"trigger": "GetCollision\t target:GetCollision(width, speed, delay)", "contents": "GetCollision(${1:width}, ${2:speed}, ${3:delay})"},

    {"trigger": "Menu_Menu\tMenuElement({type == MENU,...})", "contents": "MenuElement({type = MENU, id = \"${1:id}\", name = \"${2:nameOnMenu}\"${3:, leftIcon = \"${4:url}\"}})"},
    {"trigger": "Menu_Boolean\tMenuElement({...})", "contents": "MenuElement({id = \"${1:id}\", name = \"${2:nameOnMenu}\", value = ${3:true}${4:, callback = function(v) $5 end}})"},
    {"trigger": "Menu_Slider\tMenuElement({...})", "contents": "MenuElement({id = \"${1:id}\", name = \"${2:nameOnMenu}\", value = ${3:3}, min = ${4:1}, max = ${5:5}, step = ${6:1}${7:, callback = function(v) $8 end}})"},
    {"trigger": "Menu_DropDown\tMenuElement({...})", "contents": "MenuElement({id = \"${1:id}\", name = \"${2:nameOnMenu}\", value = ${3:dropTable_index}, drop = ${4:{\\}}${5:, callback = function(v) $6 end}})"},
    {"trigger": "Menu_Key\tMenuElement({...})", "contents": "MenuElement({id = \"${1:id}\", name = \"${2:nameOnMenu}\", key = ${3:number}, value = ${4:togge?[true/false]${5:, callback = function(v) $6 end}})"},
    {"trigger": "Menu_Color\tMenuElement({...})", "contents": "MenuElement({id = \"${1:id}\", name = \"${2:nameOnMenu}\", color = Draw.Color(${3:alphaColor}, ${4:redColor}, ${5:greenColor}, ${6:blueColor})})"},
    {"trigger": "Menu_Empty\tMenuElement({type = SPACE,...})", "contents": "MenuElement({type = SPACE, name = \"$1\"})"},

    {"trigger": "Control.CastSpell\t(HK, [nil/obj/pos])", "contents": "Control.CastSpell(${1:HK_Q}, ${2:obj/pos})"},
    {"trigger": "Control.Move\t(pos)", "contents": "Control.CastSpell(${1:pos})"},
    {"trigger": "Control.Attack\t(obj)", "contents": "Control.CastSpell(${1:obj})"},
    {"trigger": "Control.IsKeyDown\t(number)", "contents": "Control.CastSpell(${1:32--[[space]]})"},
    {"trigger": "Control.SetCursorPos\t(pos)", "contents": "Control.SetCursorPos(${1:pos})"},
    {"trigger": "Control.KeyDown\t(HK)", "contents": "Control.KeyDown(${1:HK_Q})"},
    {"trigger": "Control.KeyUp\t(HK)", "contents": "Control.KeyUp(${1:HK_Q})"},
    {"trigger": "Control.mouse_event\t(number)", "contents": "Control.KeyUp(${1:number})"},

    {"trigger": "Draw.Circle\t(pos, radius, width, color)", "contents": "Draw.Circle(${1:pos}, ${2:radius}, ${3:1}, Draw.Color($4))"},
    {"trigger": "Draw.Line\t(pos1, pos2, width, color)", "contents": "Draw.Line(${1:pos1}, ${2:pos2}, ${3:1}, Draw.Color($4))"},
    {"trigger": "Draw.Rect\t(x, y, width, heigh, color)", "contents": "Draw.Rect(${1:x}, ${2:y}, ${3:width}, ${4:height}, Draw.Color($5))"},
    {"trigger": "Draw.Text\t(text, size, pos2D, color)", "contents": "Draw.Text(${1:text}, ${2:size}, ${3:pos2D}, Draw.Color($4))"},
    {"trigger": "Draw.CircleMinimap\t(pos, radius, width, color)", "contents": "Draw.CircleMinimap(${1:pos}, ${2:radius}, ${3:1}, Draw.Color($4))"},
    {"trigger": "Draw.Color\t(alphaColor, redColor, greenColor, blueColor)", "contents": "Draw.Color(${1:255}, ${2:255}, ${3:255}, ${4:255})"},

    "Game.HeroCount()",
    "Game.Hero(${1:i})",
    "Game.ObjectCount()",
    "Game.Object(${1:i})",
    "Game.CampCount()",
    "Game.Camp(${1:i})",
    "Game.TurretCount()",
    "Game.Turret(${1:i})",
    "Game.MissileCount()",
    "Game.Missile(${1:i})",
    "Game.ParticleCount()",
    "Game.Particle(${1:i})",
    "Game.MinionCount()",
    "Game.Minion(${1:i})",
    "Game.WardCount()",
    "Game.Ward(${1:i})",
    "Game.GetObjectByNetID(${1:networkID})",

    {"trigger": "To2D()\t", "contents": "To2D()"},
    {"trigger": "Clone()\treturns a new vector", "contents": "Clone()"},
    {"trigger": "Unpack()\treturns x, y, z", "contents": "Unpack()"},
    {"trigger": "DistanceTo(newVec/nil)\t distance to newVec or myHero", "contents": "DistanceTo($1)"},
    {"trigger": "Len()\treturns length", "contents": "Len()"},
    {"trigger": "Len2()\treturns squared length", "contents": "Len2()"},
    {"trigger": "Normalize()\tnormalizes current vec(not return)", "contents": "Normalize()"},
    {"trigger": "Normalized()\tcreates newVec, normalizes and returns it", "contents": "Normalized()"},
    {"trigger": "Center(vec)\tcenter between 2 vectors", "contents": "Center($1)"},
    {"trigger": "CrossProduct(vec)\tcross product of 2 vectors (alias: CrossP)", "contents": "CrossProduct($1)"},
    {"trigger": "DotProduct(vec)\tdot product of 2 vectors (alias: DotP)", "contents": "DotProduct($1)"},
    {"trigger": "ProjectOn(vec)\tprojects a vector on a vector", "contents": "ProjectOn($1)"},
    {"trigger": "MirrorOn(vec)\tmirrors a vector on a vector", "contents": "MirrorOn($1)"},
    {"trigger": "Sin(vec)\tcalculates sin of 2 vector", "contents": "Sin($1)"},
    {"trigger": "Cos(vec)\tcalculates cos of 2 vector", "contents": "Cos($1)"},
    {"trigger": "Angle(vec)\tcalculates angle between 2 vectors", "contents": "Angle($1)"},
    {"trigger": "AffineArea(vec)\tcalculates area between 2 vectors", "contents": "AffineArea($1)"},
    {"trigger": "TriangleArea(vec)\tcalculates triangular area between 2 vectors", "contents": "TriangleArea($1)"},
    {"trigger": "RotateX(phi)\trotates vector by phi around x axis", "contents": "RotateX($1)"},
    {"trigger": "RotateY(phi)\trotates vector by phi around y axis", "contents": "RotateY($1)"},
    {"trigger": "RotateZ(phi)\trotates vector by phi around z axis", "contents": "RotateZ($1)"},
    {"trigger": "Rotate(phiX, phiY, phiZ)\trotates currentVec (not return)", "contents": "Rotate(${1:phiX}, ${2:phiY}, ${3:phiZ})"},
    {"trigger": "Rotated(phiX, phiY, phiZ)\tcreates newVec, rotates and returns it", "contents": "Rotated(${1:phiX}, ${2:phiY}, ${3:phiZ})"},
    {"trigger": "Polar()\treturns polar value", "contents": "Polar()"},
    {"trigger": "AngleBetween(vec1, vec2)\treturns the angle formed from a vector to both input vectors", "contents": "AngleBetween(${3:Vector1}, ${4:Vector2})"},
    {"trigger": "Compare(vec)\tcompares both vectors, returns difference", "contents": "Compare($1)"},
    {"trigger": "Perpendicular()\tcreates a new vector that is rotated 90° right", "contents": "Perpendicular()"},
    {"trigger": "Perpendicular2()\tcreates a new vector that is rotated 90° left", "contents": "Perpendicular2()"},
    {"trigger": "Extend(vec, distance)\textends a vector towards a vector (not return)", "contents": "Extend(${1:vec}, ${2:distance})"},
    {"trigger": "Extended(vec, distance)\tcreate newVec, extends and returns it", "contents": "Extend(${1:vec}, ${2:distance})"},
    {"trigger": "Shorten(vec, distance)\tshortens a vector towards a vector", "contents": "Shorten(${1:vec}, ${2:distance})"},
    {"trigger": "Shortened(vec, distance)\tcreates newVec, shortens and returns it", "contents": "Shortened(${1:vec}, ${2:distance})"},
    {"trigger": "Lerp(vec, delta)\tcreates a new vector, lerps it towards vector by delta", "contents": "Lerp(${1:vec}, ${2:delta})"}
]

}

我把它保存为source.lua,然后把它放在我的包文件夹中。我在Mac上,当我尝试使用自动完成时,没有任何内容被加载。说"没有可用的完成。"我做错了什么?

1 个答案:

答案 0 :(得分:1)

保存的文件名需要具有sublime-completions的扩展名,以便Sublime知道它包含一组完成。

如果您将其另存为lua文件,Sublime并不知道它包含完成,而是假设它是一个常规的L​​ua文件。