Maligosus / 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 1.7+ syntax.

Version Installs Rating Last commit Open issues Closed issues Code Factor GitHub Workflow Status codecov

Example

Features

  • Compile from VSCode with a simple button.
  • Autocompletion.
  • Go to definition.
  • Code outline.
  • Upload to an FTP/SFTP server on successful compile.
  • Automatically run sm plugins refresh on a successful upload.
  • Hover for details.
  • Add icons for .smx, .sp and .inc files
  • Automatically scan include files for natives, defines, methodmaps and more.
  • Useful snippets.
  • Detailed highlighting for .sp, .inc, .cfg, .games.txt and .phrases.txt.
  • Parse sourcemod files from a custom location.
  • Linting capabilities.

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

Code outline

Outline 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 fix "Not a .sp file, aborting" ?

This usually happens when you have sourcepawn.MainPath set but don't actually need it. This setting is only to be used for large projects with multiple .sp files, as a way to provide an entry point for the compiler. Don't use this setting if you don't need to. NOTE: This error shouldn't appear as much as of version 1.12.0.

How to fix "Command not found" ?

The Command not found error means that the extension could not start properly. This is usually due to the user trying to open a single file only and not a folder. As of version 1.12.0, this is partly supported, however, for full support, please open a folder when editing a project, and not just the .sp file.

How to install the beta build ?

First, go to the releases page and download the .vsix file attached to the latest release. Then, open VSCode and in the extension manager, click on the ... icon and select install from VSIX. Select the file you've just downloaded and you're done.

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 66.1%Language:SourcePawn 33.6%Language:JavaScript 0.2%Language:Pawn 0.1%