BabeLua is a Lua integrated development based on VS2012/2013 Environment, with Lua syntax highlighting, syntax checking, automatic completion, quick search, inject into the host program to debug Lua scripts, set breakpoints to observe variable values, view stack information and other functions.
How to install
Please refer to “Series 1—Introduction to BabeLua”
NewLua Engineering
On the VS menu, select: [lua] [New Lua Project] to create a Lua project, as shown below:
(1) Lua scripts folder
Lua code path, all Lua files in this directory will be listed in “Folder Explorer” out.
(2) Lua exe path (used during debugging, required parameter during debugging)
< p style="color:rgb(54,46,43); font-family:Arial; font-size:14px; line-height:26px"> The path of the exe file started during debugging, referred to as Lua exe.
(3) Working path (used during debugging, optional parameters during debugging)
When starting “Lua exe”, this parameter is used as the working directory parameter of the startup process.
Generally can be consistent with “Lua scripts folder”, not If this item is set, the default value is the directory where “Lua exe” is located.
Tips: Call GetCurrentDirectory of Windows API to get this path.
(4) Commond line (used during debugging)
The command line parameters passed to “Lua exe” when starting debugging.
(5) Lua project name
Lua project name.
Click the [OK] button to create a Lua project.
LuaFile Management
img src=”/wp-content/uploadshttp:/img.voidcn.com/vcimg/static/loading.png” alt=”” style=”border:none; max-width:100%” d=”3564952″ s =”2dd_89d” t=”jpg”>
Top In the figure, right-click to create new folders, create/delete Lua files, rename files, etc.
Quick searchLuaFile
Use shortcut keys Alt + LStart the searchLuafile window, Enter part of theLuafile name to quickly find the file.
Display line number, indent Enter (use tab or space), customizeVStheme color
via VSMenu[Tools]->[Options]Open Setting interface
fast positioning function And variables (Outline Explorer)
Shortcut key: Ctrl+2
Lua syntax highlighting, syntax checking, automatic complement Full
Lua syntax highlighting, syntax checking, and auto-completion are as follows:
Smart completion and whole word completion
The two tab pages “IntelliSense” and “All Words” of the auto-completion list are smart completion and full word completion respectively.
Smart completion: lists after grammatical analysis Words (precise)
Complete word completion: lists all the words that have appeared (complete)
By default, smart completion is turned on. Use the shortcut key Ctrl+J to switch between smart completion and full word completion.
Smart completion:
Whole word completion:
Add cocos2dAuto-complete thesaurus
cocos2d-x thesaurus download:
Download address: http://pan.baidu.com/s/1sjmC169
Choose to download the corresponding version of the cocos2d-x thesaurus file, put it in the [My Documents] [BabeLua] [Completion] directory, and restart VS.
How to open Windows7 and Windows8 [My Documents]Contents?
Double-click on the desktop to open the computer, and click “document” in the list on the left to open[My Documents]Contents.
Code segment completion< /h1>
Enter the code segment keyword and press TabPerform code segment completion
Quick search for keywords
Ctrl+Double click:From Current file search
Alt+Double click: Search from the current project
Ctrl+F: Search from the current file
Ctrl+Shift+F: From Search in the current project
Quick search function
h1>
Shortcut key: Ctrl+P
Go to definition (variable, function)
Shortcut: F12
< p style="color:rgb(54,46,43); font-family:Arial; font-size:14px; line-height:26px"> Position the cursor on the variable or function and press F12You can jump to the definition of the variable or function.
formatting code h1>
Ctrl + K,Ctrl + D: Format the current file
Ctrl + K,Ctrl+F: format the selected code
Comment
Ctrl + K ,Ctrl + C: Comment the selected text line
Ctrl+K,Ctrl+U : Uncomment the selected text line
Code folding
Ctrl+M,Ctrl+M: Fold or unfold the current code block
Ctrl+M,Ctrl+L : Fold or unfold all code blocks in the document
Synchronize files and folders
Right click on LuaProject or directory, select “Synchronize files and folder“Can synchronize external files and folders toLua Under construction.
LuaDebug
Set Lua as a startup project
When your “Solution Manager” contains multiple projects, you need to set the Lua project as the startup project.
Set breakpoints
Click the gray area on the left to add a breakpoint (set breakpoint shortcut F9) .
Start debugging
Press F5 to start the “Lua exe” process to start debugging.
View variables, stack information, output information< /h2>
After hitting the interruption point, you can view the variable and stack information, As shown below:
(1) Stack information
(2) Monitoring variables
(3) Move the mouse to the variable to view the variable value
(4) Breakpoint information
(5) Output information
Press F10 step by step, F11 step by step to track and debug.
Press F5 to continue to run HelloLua.exe
Debug shortcut keys
F5: Continue
F9: add/remove breakpoints
F10: Process by process
F11 : Sentence by sentence
Shift+F5: Stop debugging