2024-02-01 14:18:50 -05:00
|
|
|
## [:rewind: Lua Reference](../lua.md)
|
2022-03-12 21:47:48 -08:00
|
|
|
|
|
|
|
Setting up Visual Studio Code will allow you to have all of the modern benefits of IDEs like autocomplete.
|
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2022-03-12 21:47:48 -08:00
|
|
|
1. Install the `Lua` extension by `sumneko` in VS Code:
|
|
|
|
|
|
|
|

|
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2022-03-12 21:47:48 -08:00
|
|
|
2. Goto settings (`ctrl+,`) and type `diagnostics disable` in the settings search bar:
|
|
|
|
|
|
|
|

|
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2022-03-12 21:47:48 -08:00
|
|
|
3. Add a new item called `lowercase-global` and click `ok`
|
|
|
|
|
|
|
|

|
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2022-03-12 21:47:48 -08:00
|
|
|
4. Type `workspace library` in the settings search bar:
|
|
|
|
|
|
|
|

|
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2024-10-07 22:13:19 +10:00
|
|
|
5. Add a new item containing the location of `<your repo>/autogen/lua_definitions`
|
2022-03-12 21:47:48 -08:00
|
|
|
|
|
|
|

|
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2022-03-12 21:47:48 -08:00
|
|
|
6. Open a lua mod file be amazed at autocompletion and all of that good stuff
|
2022-03-12 21:52:38 -08:00
|
|
|

|
2022-03-12 21:47:48 -08:00
|
|
|
|
2022-03-12 21:49:05 -08:00
|
|
|
---
|
|
|
|
|
2022-03-12 21:47:48 -08:00
|
|
|
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
|
|
|
|
```
|