AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [TOOLS] Atom Sourcepawn Syntax Highlighting v0.6.0 (https://forums.alliedmods.net/showthread.php?t=252873)

Wliu 12-10-2014 18:58

[TOOLS] Atom Sourcepawn Syntax Highlighting v0.6.0
 
So I've managed to release a (somewhat functioning) package for Atom that will automatically detect and highlight Sourcepawn files (provided that they end in .sp or .inc). It's a bit difficult to get an accurate screenshot since different syntax themes will colorize everything differently, but here's an idea of what gets colorized:
http://i.imgur.com/TZ8M0Wi.png

This is a pretty big work-in-progress (as you can see from the screenshot itself), so hopefully things will improve as I gain more experience with regex. SOURCEMOD 1.7 IS NOT FULLY SUPPORTED YET.

Installation:
1. Open up the Settings View in Atom
2. Click on 'Install' in the left column
3. Search for 'language-sourcepawn'
4. Install!
A direct link to the package is also available here.

The changelog is visible by clicking on the package's settings and then selecting 'Open Changelog'. Update notifications are handled automagically by Atom; you just need to press the Update button.

The source code is available here under the MIT license (just to be on the safe side, since I took lots of the regex from MIT-licensed packages).

Drixevel 12-13-2014 02:22

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting
 
This tool is amazing! Thank you for the program advertisement and the plugin.

Wliu 12-13-2014 19:33

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting
 
@r3dw3r3w0lf: I honestly can't tell if that's sarcasm or not :P.

Anyway, I've just released v0.2.0. This version identifies INVALID_HANDLE as a constant, identifies stock as a storage modifier, fixes legacy storage types also being classified as ternaries, and fixes tagged functions not being recognized (like the Action:Timer_CheckDoors() in the picture).

The next version will probably properly recognize all storage types, not just the basic ones (String:, Float:, any:, etc). Plugin_{Continue|Changed|Handled|Stop} will also be classified as constants.

The screenshot will be updated as soon as I get back to my laptop (it'll also show highlighting for 'public' now!).

Drixevel 12-13-2014 20:36

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting
 
Quote:

Originally Posted by Wliu (Post 2235030)
@r3dw3r3w0lf: I honestly can't tell if that's sarcasm or not :P.

Anyway, I've just released v0.2.0. This version identifies INVALID_HANDLE as a constant, identifies stock as a storage modifier, fixes legacy storage types also being classified as ternaries, and fixes tagged functions not being recognized (like the Action:Timer_CheckDoors() in the picture).

The next version will probably properly recognize all storage types, not just the basic ones (String:, Float:, any:, etc). Plugin_{Continue|Changed|Handled|Stop} will also be classified as constants.

The screenshot will be updated as soon as I get back to my laptop (it'll also show highlighting for 'public' now!).

It wasn't sarcastic. This program is awesome! It's a lot easier to keep up with a constant workflow.

Also, question: (Might be off-topic but...)

Do you know of a method of compiling a plugin with a keybind similar to NPPExec for Notepad++? You basically set a keybind and it compiles the SP file into an SMX file via the 'spcomp.exe' program and move the file, etc.

Wliu 12-13-2014 21:03

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.2.0
 
In that case, thanks! I've been using Atom since about May of this year, and it was bugging me how I was having to revert to C++ syntax highlighting, so I finally decided to make an actual Sourcepawn package.

As for something like NPPExec, I found run-command and terminal-status. Not exactly the same, but better than nothing ;).

Wliu 12-19-2014 21:58

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.2.0
 
0.3.0 is out which fixes untagged functions not being scoped. It also adds Plugin_* as constants, forward as a storage modifier, and #endinput as a preprocessor keyword.

Updated picture will be out tomorrow.

EDIT: I'm aware that .inc is incorrectly recognized as PHP. There's nothing I can do about this-PHP also interprets .inc as a valid file type and takes precedence over Sourcepawn (maybe because PHP comes before Sourcepawn in the alphabet?). There's currently a Github issue tracking this, but there's not much else anyone can do.

braak0327 12-20-2014 04:18

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.0
 
thanks for your work!

Bubka3 12-21-2014 11:07

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.0
 
Thank you for doing this!

Wliu 01-10-2015 18:20

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.1
 
Thanks for the support :).

0.3.1 has just been released to remove a deprecation (the scoped-properties folder has been renamed to settings). As a result, you now need at least Atom 0.166.0 for this package to work correctly.

Bubka3 01-12-2015 08:00

Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.1
 
Have you been able to compile directly from Atom?

It's something I can do in Sublime and I really miss it.


All times are GMT -4. The time now is 05:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.