BoneTM / sourcepawn-vscode

VSCode extension for SourcePawn scripting

Home Page:https://marketplace.visualstudio.com/items?itemName=Sarrus.sourcepawn-vscode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SourcePawn for VSCode

SourcePawn highlighting and autocompletion for Visual Studio Code. Supports the SourceMod old and new syntax.

Example

Features

  • Compile from VSCode with a simple button.
  • Autocompletion.
  • Go to definition.
  • Symbol references.
  • Symbol renaming.
  • Function signature help.
  • Call hierarchy
  • Code outline.
  • Upload to an FTP/SFTP server on successful compile.
  • Automatically run sm plugins refresh on a successful upload.
  • Hover for details.
  • Icons for .smx, .sp and .inc files
  • Automatically scan include files for natives, defines, methodmaps and more.
  • Useful snippets.
  • Detailed semantic highlighting for .sp, .inc, .cfg, .games.txt and .phrases.txt.
  • Parse sourcemod files from a custom location.
  • Linter (error detection) for .sp and .cfg files.

Details on how to use the extension available in the Wiki.

Screenshots

.sp and .inc file highlighting

.sp highlighting example

.cfg file highlighting

Highlighting example

Code auto-completion

Completion example

Event auto-completion

Completion example

Include auto-completion

Completion example

Callback auto-completion

Completion example

Code outline

Outline example

Call Hierarchy

Hierarchy example

Symbol references

References example

Symbol renaming

Renaming example

Functions signature help

Signature example

Hover help

Hover example

Go To Definition

Go to definition example

Linter

Linter example

Credits

  • Dreae's extension which is not supported anymore, and on which this extension is based on.
  • Deathreus' extension which helped me to implement the linting feature.
  • Everybody that has helped me improved the extension on the discord server.

Frequently Asked Questions

How can I donate ?

Thanks for considering this. But please remember that all of this wouldn't be possible without the Alliedmodders community. If you wish to make a donation for this community, you can make it here. If you prefer to make a donation to me for this project, you can buy me a coffee

How to install the beta build ?

  1. Open VSCode and go to the marketplace.
  2. In the search bar, type SourcePawn and select the extension.
  3. Click on Switch to Pre-Release (see screenshot below).

Pre-release

This will install the latest development build of the extension.

Note that a new build might take a few minutes (up to 15) to propagate to the Marketplace after the commit has been pushed to the dev branch.

You can also install the latest pre-release by downloading the .vsix from the releases page and installing it manually.

How to contribute ?

Pull requests and suggestions are welcome.

  • To make a suggestion or to report an issue, please create a new issue here.
  • To make a contribution, fork the repository, make the desired changes, and open a pull request.

How to run the extension from its source code ?

To run the extension from the source, do the following:

  • Install node.js on your machine. Make sure npm is installed as well.
  • Fork this repository and clone it on your machine (do this with VSCode for easier manipulation).
  • Run npm install from the root of the project folder.
  • Run npm run watch.
  • Press f5 to run the extension in dev mode.

About

VSCode extension for SourcePawn scripting

https://marketplace.visualstudio.com/items?itemName=Sarrus.sourcepawn-vscode

License:MIT License


Languages

Language:TypeScript 70.9%Language:SourcePawn 27.3%Language:JavaScript 0.7%Language:Python 0.5%Language:PEG.js 0.5%Language:Pawn 0.1%