Raised This Month: $32 Target: $400
 8% 

[TOOLS] Atom Sourcepawn Syntax Highlighting v0.6.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wliu
Veteran Member
Join Date: Apr 2013
Old 12-10-2014 , 18:58   [TOOLS] Atom Sourcepawn Syntax Highlighting v0.6.0
Reply With Quote #1

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:


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).
__________________
~Wliu

Last edited by Wliu; 02-28-2016 at 21:13. Reason: 0.6.0
Wliu is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 12-13-2014 , 02:22   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting
Reply With Quote #2

This tool is amazing! Thank you for the program advertisement and the plugin.
Drixevel is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 12-13-2014 , 19:33   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting
Reply With Quote #3

@r3dw3r3w0lf: I honestly can't tell if that's sarcasm or not .

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!).
__________________
~Wliu
Wliu is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 12-13-2014 , 20:36   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting
Reply With Quote #4

Quote:
Originally Posted by Wliu View Post
@r3dw3r3w0lf: I honestly can't tell if that's sarcasm or not .

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.
Drixevel is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 12-13-2014 , 21:03   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.2.0
Reply With Quote #5

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
Wliu is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 12-19-2014 , 21:58   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.2.0
Reply With Quote #6

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.
__________________
~Wliu

Last edited by Wliu; 12-19-2014 at 22:02.
Wliu is offline
braak0327
AlliedModders Donor
Join Date: Dec 2012
Location: NORT....SOUTH KOREA
Old 12-20-2014 , 04:18   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.0
Reply With Quote #7

thanks for your work!
__________________
I'M KIMCHI
braak0327 is offline
Send a message via Skype™ to braak0327
Bubka3
Sir Buzz Killington, Esq.
Join Date: Jan 2010
Location: New York, NY
Old 12-21-2014 , 11:07   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.0
Reply With Quote #8

Thank you for doing this!
Bubka3 is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 01-10-2015 , 18:20   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.1
Reply With Quote #9

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.
__________________
~Wliu
Wliu is offline
Bubka3
Sir Buzz Killington, Esq.
Join Date: Jan 2010
Location: New York, NY
Old 01-12-2015 , 08:00   Re: [TOOLS] Atom Sourcepawn Syntax Highlighting v0.3.1
Reply With Quote #10

Have you been able to compile directly from Atom?

It's something I can do in Sublime and I really miss it.
Bubka3 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:52.


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