openmultiplayer / vscode-pawn

VS-Code extension for pawn language
https://open.mp
MIT License
16 stars 6 forks source link

pawn-development

VS-Code extension for Pawn language
Originally created by Indian Ocean Roleplay™ (samarmeena)

Features

Define Custom Snippet Anywhere

You can define two types of snippet
*Note: second type support autocompletion of parameters.

//#snippet new_cmd CMD:cmd_name(playerid, const params[]) {\n\treturn 1;\n}

//#function CreateCar(vehicleid, Float:posX, Float:posY, Float:posZ);

Usage of .pawnignore

Right click on on your files to add to .pawnignore, this way you'll tell extension not to parse these files for auto-complete and intellisense.
*Note: syntax works exactly like .gitignore.

Installation

Search for "Pawn Development" in the vscode extensions section and install it.
Alternatively, you can check out the source code or view the marketplace page:

Creating tasks.json

Press Ctrl + Shift + P or F1 and then type >Initialize Pawn Build Task

Explanation

Define single gamemode file that always compile on build task

  1. goto .vscode/tasks.json
  2. replace ${relativeFile} with ${workspaceRoot}\\gamemodes\\mygamemode.pwn
  3. all done

Compiling Pawn Code

To actually compile after you've set up the tasks.json below, press CTRL + Shift + B (Windows) or CMD + Shift + B (Mac), or alternatively open up the command palette with CTRL + Shift + P (Windows) or CMD + Shift + P (Mac) and type Run Task, hit enter and select build-normal.