AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Sublime Text 3 - SourcePawn Syntax Highlighting (20w03c) (https://forums.alliedmods.net/showthread.php?t=307577)

404UserNotFound 05-15-2018 20:18

Sublime Text 3 - SourcePawn Syntax Highlighting (20w03c)
 
So I went and made a thing. This is a brand new version of the SP syntax highlighting that I first released. I started from a new .sublime-syntax file to take advantage of variable storage.

This is meant as a beta testing release. Please report any instances of things not highlighting correctly here.


ThatKidWhoGames 05-15-2018 21:04

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
I actually love you! Installing this right as I can, thank you!

404UserNotFound 05-16-2018 00:28

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
I had planned on an initial release a few weeks ago, but life got in the way. Finally found the energy and drive to get this thing done and ready for the release.

I'll be adding in more custom include file highlighting over time. I'm working on a batch as we speak that I hope to push out tomorrow.

Maxximou5 05-16-2018 02:08

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Looks pretty darn good. I'm not sure how I feel about all the dark colors, blues and greens.
Really like the option of 1point6 and 1point7.
However, if you find the time, you should submit the package.

404UserNotFound 05-16-2018 13:05

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Quote:

Originally Posted by Maxximou5 (Post 2592395)
Looks pretty darn good. I'm not sure how I feel about all the dark colors, blues and greens.
Really like the option of 1point6 and 1point7.
However, if you find the time, you should submit the package.

I definitely do want to submit the package. I'll check that out in a bit. If you don't want to use the color scheme, tack .disabled (or any gibberish really) to the end of the file extension of the .sublime-settings file. It'll stop forcing that color scheme for SP files allowing your chosen color scheme to be used. You can also install Color Scheme Editor through Package Control and edit the colors that way if you so desire.

Lubricant Jam 05-17-2018 03:55

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Someone needs to do a good version of this for Visual Studio Code O.o

EDIT: Nvm, I found one https://marketplace.visualstudio.com...rcepawn-vscode

Good work, however.

404UserNotFound 05-17-2018 05:04

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Quote:

Originally Posted by Lubricant Jam (Post 2592518)
Someone needs to do a good version of this for Visual Studio Code O.o

EDIT: Nvm, I found one https://marketplace.visualstudio.com...rcepawn-vscode

Good work, however.

I think VSCode also uses .tmLanguage files, so this should be compatible. Edit: Yes it is compatible, but more importantly, it's compatible with any other text editors that utilize the TextMate system (.tmTheme, .tmSnippets and .tmLanguage files). If I used VSCode, I'd probably combine this with the autocompletion functionality from the package you linked but that's just because I like customizing things. Right now I use a SourcePawn Completions package in ST3 that I'm quite happy with.

Thanks for the kind words (even though you tripped me up at first making me think my highlighting was crap with "Someone needs to do a good version of this", I'm tired and I think I read that wrong at first)

Lubricant Jam 05-17-2018 10:51

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Quote:

Originally Posted by 404UNF (Post 2592523)
I think VSCode also uses .tmLanguage files, so this should be compatible. Edit: Yes it is compatible, but more importantly, it's compatible with any other text editors that utilize the TextMate system (.tmTheme, .tmSnippets and .tmLanguage files). If I used VSCode, I'd probably combine this with the autocompletion functionality from the package you linked but that's just because I like customizing things. Right now I use a SourcePawn Completions package in ST3 that I'm quite happy with.

Thanks for the kind words (even though you tripped me up at first making me think my highlighting was crap with "Someone needs to do a good version of this", I'm tired and I think I read that wrong at first)

My bad dude haha :bacon!:

Psyk0tik 05-18-2018 08:39

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Thank you for this. Looks pretty cool so far! :bacon!::bacon!::bacon!:

404UserNotFound 05-19-2018 18:10

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Currently working on an expansion to the custom include highlighting that will add support for the following includes;
  • SteamWorks (85%)
  • SteamTools (0%)
  • SMLib (5%)
  • MoreColors (100%)
  • MultiColors (0%)
  • Bank (0%)
  • Maybe some others...
Authors of includes will be added to the Github README.md as well. I meant to add those in initially but I was more focused on getting this released first.

JoinedSenses 07-29-2018 11:39

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
String highlighting edit:

Code:

                <dict>
                        <key>begin</key>
                        <string>"</string>
                        <key>patterns</key>
                        <array>
                                <dict>
                                <key>name</key>
                                <string>constant.other.placeholder.SourcePawn</string>
                                <key>match</key>
                                <string>%(d|\d*\.*\d*f|i|s|L|N|t|T|u|x|X)</string>
                                </dict>
                                <dict>
                                <key>name</key>
                                <string>constant.character.escape.SourcePawn</string>
                                <key>match</key>
                                <string>(\\x0\d|\\n)</string>
                                </dict>
                        </array>
                        <key>end</key>
                        <string>"</string>
                        <key>name</key>
                        <string>string.SourcePawn</string>
                </dict>


Donatello4620 08-09-2018 14:41

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Thanks a lot, looking great here :>

goalevo 09-05-2018 03:02

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Sublime text 3 vs VS Code, which is better? :)

404UserNotFound 12-12-2018 22:09

Re: Sublime Text 3 - SourcePawn Syntax Highlighting
 
Now that the semester is over, I went and released an update to this (finally). Everything is current and up-to-date with the include files in the latest 1.10 build (6364). All the new cstrike.inc stuff for the Battle Royale mode too.

Here's a link to it on Github. The main post of this thread has been updated too so that the link actually works.

Apologies to anyone I disappointed for not delivering this sooner; that wasn't intentional. I'm a perfectionist.

404UserNotFound 12-16-2018 19:46

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51a)
 
Update 18w51a pushed:
- General cleanup including the removal of a few commented-out lines of old regexes.
- Added a fix for a minor highlighting bug involving the newly-added enum struct to SourcePawnNew.sublime-syntax.


Update 18w51b pushed:
- Added CSWeapon_SNOWBALL ahead of this pull request being accepted.
- Re-added original enum highlighting code for not highlighting 1.6 variable declarations within enums as invalid. Enums still can use old syntax declarations, so until the day comes that old syntax is no longer supported at all, I have to keep supporting the usage.


Also, I gather by the lack of reports thus far that no highlighting edge cases that I missed have been found. So far so good!

MsDysphie 01-17-2019 21:49

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51b - Dec 19th)
 
Looking nice, though personally, it bothers me that non-native functions get no highlighting at all.



404UserNotFound 01-18-2019 15:04

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51b - Dec 19th)
 
Quote:

Originally Posted by MsDysphie (Post 2635240)
Looking nice, though personally, it bothers me that non-native functions get no highlighting at all.

Yeah, that's a side effect of this highlighting being (for the most part) manually defined. I am working on a version that uses ST3's C# highlighting as a base so that all custom content will have highlighting. ST3's C# highlighting is very regex-heavy so I have to go through it and bit by bit figure out what each and every thing affects and go from there.

For the time being (since work on the aforementioned version is going to take a while), one could always add in custom highlighting for their own favorite includes. I should put together a quick guide on adding in entries for custom include files (i.e. DHooks, TF2Items, etc). Or I could just toss in highlighting for some of the more popular custom includes. I did go and make this (still incomplete) list of custom includes created by the community, so I've got a nice list I can reference.

Edited:
Working on a new update to the highlighting that adds in highlighting for some custom includes.

Here's your example in the new version of the highlighting MsDysphie:
https://i.imgur.com/vUTX533.png

New version will be out....err....soon-ish. Keep tabs on the Github.

Edited (again, Jan 21st): I've already added in highlighting for the following (and I'm not done yet!):

Munoon 03-13-2019 12:30

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51b - Dec 19th)
 
Im love it

blackdevil72 04-18-2019 19:29

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51b - Dec 19th)
 
Thank you a lot for this. It has made my life so much more simple.

Just a question though.

In both 1.6 and 1.7+ coloring the function FloatDiv is highlighted in red. Is there any reason for that or is it a bug?

404UserNotFound 04-18-2019 21:09

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51b - Dec 19th)
 
Quote:

Originally Posted by blackdevil72 (Post 2648113)
Thank you a lot for this. It has made my life so much more simple.

Just a question though.

In both 1.6 and 1.7+ coloring the function FloatDiv is highlighted in red. Is there any reason for that or is it a bug?


Same with FloatMul, FloatAdd and FloatSub. They're considered deprecated by float.inc, as they are for internal implementation.

See https://github.com/alliedmodders/sou...at.inc#L48-L94
Code:

#pragma deprecated This native is internal implementation. For multiplication use the '*' operator.
#pragma deprecated This native is internal implementation. For division use the '/' operator.
#pragma deprecated This native is internal implementation. For addition use the '+' operator.
#pragma deprecated This native is internal implementation. For subtraction use the '-' operator.


blackdevil72 04-18-2019 22:18

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (18w51b - Dec 19th)
 
Thanks a lot, I guess I'll have to look more and GitHub now rgz website look a bit out of date.

404UserNotFound 01-11-2020 23:14

Re: Sublime Text 3 - SourcePawn Syntax Highlighting (20w03b)
 
Version 20w03b has been released, bringing the syntax highlighting up to date with SourceMod 1.11 build 6481.

Custom include support for many widely-used .inc's (tf2items, tf2attributes, maybe smlib) soon.

Enjoy!


Edit: So the forum's still doing that thing where one line break turns into two when you submit a post.


All times are GMT -4. The time now is 22:16.

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