mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Document how to setup vscode
This commit is contained in:
parent
08d4818ba7
commit
b77a2b62c9
2 changed files with 44 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ Lua scripts you make can be placed either the `mods` folder in the base director
|
||||||
## Tips
|
## Tips
|
||||||
- When developing Lua mods, run the game from a console. Lua errors and logs will appear there.
|
- When developing Lua mods, run the game from a console. Lua errors and logs will appear there.
|
||||||
- You can use the `print()` command when debugging. Your logs will show up in the console.
|
- You can use the `print()` command when debugging. Your logs will show up in the console.
|
||||||
|
- [Setting up Visual Studio Code](vs-code-setup.md) will give you autocomplete and other nice things.
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|
|
||||||
43
docs/lua/vs-code-setup.md
Normal file
43
docs/lua/vs-code-setup.md
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
## [:rewind: Lua Reference](lua.md)
|
||||||
|
|
||||||
|
Setting up Visual Studio Code will allow you to have all of the modern benefits of IDEs like autocomplete.
|
||||||
|
|
||||||
|
1. Install the `Lua` extension by `sumneko` in VS Code:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. Goto settings (`ctrl+,`) and type `diagnostics disable` in the settings search bar:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. Add a new item called `lowercase-global` and click `ok`
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. Type `workspace library` in the settings search bar:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
5. Add a new item containing the location of `<your repro>/autogen/lua_definitions`
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6. Open a lua mod file be amazed at autocompletion and all of that good stuff
|
||||||
|

|
||||||
|
|
||||||
|
Note: For your custom functions you will need to provide type definitions to get autocomplete.
|
||||||
|
|
||||||
|
For instance, this will not autocomplete for the mario struct:
|
||||||
|
```
|
||||||
|
function mario_update(m)
|
||||||
|
-- code here
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
But this will autocomplete for the mario struct:
|
||||||
|
```
|
||||||
|
--- @param m MarioState
|
||||||
|
function mario_update(m)
|
||||||
|
-- code here
|
||||||
|
end
|
||||||
|
```
|
||||||
Loading…
Add table
Reference in a new issue