• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Visual Studio Code extension for GBA script syntax highlighting

36
Posts
13
Years
I've quickly thrown together an extension for .inc script syntax highlighting for VS Code, as I surely can't be the only developer here to prefer it over plain text editors. I've just packaged it as a local extension you can easily install from the .vsix file. All suggestions welcome.

Features:
  • Language support as 'pkmnscript', for lack of a better name.
  • Syntax highlighting for labels, macros and strings in .inc files.
  • Use of @ for single-line comments (e.g. for Ctrl+/).

Screenshots:
Spoiler:
 

Attachments

  • pokemon-decomp-script-1.0.0.zip
    2.8 KB · Views: 251
137
Posts
10
Years
  • Age 35
  • Seen today
I was going to do this! Now I don't have to. Nice work.

Battle scripts could do with syntax highlighting as well; I might ask around to see if it's feasible to give them a separate file extension to that end.
 
55
Posts
14
Years
  • Seen Feb 1, 2023
I don't know if this is the right place for this, but seeing as the topic is VS Code, I'll give it a shot: does anyone know how to actually fix all the C++ errors in VS Code? Right now I have "error squiggles" disabled, which only half solves the problem. I mean actually fixing the errors. For example, in main_menu.c I get an error:
Code:
identifier "SHINY_ODDS" is undefined
I think it's just an import issue, but I don't really understand the codebase well enough to know what/how to import. (And it's only an issue in VS Code -- the compiler itself is perfectly happy.)

I'm using pokeemerald, btw, but my question probably applies to other decomps as well.
 
50
Posts
6
Years
  • Age 25
  • Seen Oct 20, 2023
@Black cat: Try going to view extentions c/c++ right click extension settings and try changing C_Cpp › Default: Intelli Sense Mode to something like clang-arm. Worked for me.

@everyone: Go to view extensions [...] install from VSIX to install the extension.

@Samug Thanks !
 
55
Posts
14
Years
  • Seen Feb 1, 2023
@Black cat: Try going to view extentions c/c++ right click extension settings and try changing C_Cpp › Default: Intelli Sense Mode to something like clang-arm. Worked for me.

...

Hi, Hestia. I really appreciate the reply! Unfortunately, that did not really work for me. It does seem like there are fewer errors, though :)

For example, in src\battle_script_commands.c, the following lines still give me the error function call is not allowed in a constant expression:

Code:
static const u16 sUnknown_0831C2C8[] = INCBIN_U16("graphics/battle_interface/unk_battlebox.gbapal");
static const u32 sUnknown_0831C2E8[] = INCBIN_U32("graphics/battle_interface/unk_battlebox.4bpp.lz");

On top of that, it's still complaining about undefined vars, but at least the number of complaints has decreased significantly. I'm on Windows, btw.

Thanks again!
 
50
Posts
6
Years
  • Age 25
  • Seen Oct 20, 2023
Seems likeI misinformed you, after all, it did't work for me. It doesn't highlight any error, but that is fine since the compiler does a great job. Did you opened the whole pokeemerald dir in vscode, so that it can find the files includes and data?
 
55
Posts
14
Years
  • Seen Feb 1, 2023
Seems likeI misinformed you, after all, it did't work for me. It doesn't highlight any error, but that is fine since the compiler does a great job. Did you opened the whole pokeemerald dir in vscode, so that it can find the files includes and data?

Yep. It's opened at the /pokeemerald folder. I'll try reopening the workspace and see if that helps...

Edit: it didn't help. I do see info msgs telling me the IDE is searching thru includes when VS Code starts, but it still ends up with a bunch of errors :(
 
Last edited:
Back
Top