Toggle search
Search
Toggle menu
Toggle personal menu
Editing
Modding/Using Visual Studio Code
(section)
From Desynced Wiki
Read
Edit
Edit source
View history
Page
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== For Developers At Stage Games === When working with the internal code base at Stage Games, the Lua extension can get confused about custom pre-compiler directives. To make it ignore #if/#elif/#else/#endif in Lua code, a small modification of the Lua extension is needed. In VS Code, press <code>CTRL + SHIFT + P</code>, write ">open extensions folder" and press enter. Then browse into <code>sumneko.lua-VERSION-win32-x64/server/script/parser</code> and drag the file <code>compile.lua</code> into VS Code. Find the function <code>skipComment</code> near line 532 and change the first few lines of code to the following then save and restart VS Code: <syntaxhighlight lang="lua">local function skipComment(isAction) local token = Tokens[Index + 1] if token == '--' or ( token == '//' and ( isAction or State.options.nonstandardSymbol['//'] ) ) or ( token == '#' and (Tokens[Index + 3] == 'if' or Tokens[Index + 3] == 'elif' or Tokens[Index + 3] == 'else' or Tokens[Index + 3] == 'endif') ) then</syntaxhighlight> When the extension is updated (automatically or manually) this change needs to get applied again. {{ModdingNav}}
Summary:
Please note that all contributions to Desynced Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Desynced Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)