Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UnrealScript.tmLanguage #1

Merged
merged 6 commits into from
Mar 1, 2013
Merged

Create UnrealScript.tmLanguage #1

merged 6 commits into from
Mar 1, 2013

Conversation

rokit
Copy link
Contributor

@rokit rokit commented Feb 1, 2013

I created a more fleshed out version of an UnrealScript syntax highlighter for Sublime.  Based on keywords from DougClayton4231's syntax highlighter for Notepad++.

http://forums.epicgames.com/threads/894604-New-Unrealscript-Highlighter-For-Notepad

A more fleshed out version of an UnrealScript syntax highlighter for Sublime.  Based on keywords from DougClayton4231's syntax highlighter for Notepad++.

http://forums.epicgames.com/threads/894604-New-Unrealscript-Highlighter-For-Notepad
@Zinggi
Copy link
Owner

Zinggi commented Feb 1, 2013

Hey really cool.
I thought no one is going to find this that early. I planned to promote it in the UDK forums once it is accepted to package control, but you already found it.
Regarding your tmLanguage file: how about changing keywords like: var, function, simulated, local,... to blue? In my eyes the red is too aggressive. (I'm using the default theme)
Also some keywords are missing. Some I've spotted are: reliable, server, exec,.. they should be in the same color as function.

If you could update it a little, I'd really like to include the file as it would make the setup to get a good UnrealScript IDE even easier. Also the guy who did the one I'm currently using doesn't seem to be interested in it anymore..

@Zinggi
Copy link
Owner

Zinggi commented Feb 1, 2013

also, how about making the math symbols red, like it is done in other syntax highlighters?
such as: *-/+=>< and so on.

@Zinggi
Copy link
Owner

Zinggi commented Feb 1, 2013

oh and just to inform you I won't be able to reply back for 1 or 2 weeks, as I'm going away on holidays right now.

@rokit
Copy link
Contributor Author

rokit commented Feb 1, 2013

Awesome. Yeah, I can definitely add those keywords. The more the better. As far as the colors I don't think they can be defined in the tmLanguage file itself. I think that's taken care of by the theme you are using. I'm pretty sure I know what color you're talking about. Kind of a godawful bright pinkish color right? I had to change that myself. You can change it by opening Preferences > Browse Packages > Color Scheme - Default > Monokai.tmTheme around lines 122 and 135. We could also just designate that color for the section with the least amount of keywords.

And yeah, I noticed this plugin was only a few days old lol. Really glad I found it. It totally rocks, man. Enjoy the holiday!

rokit added 4 commits February 1, 2013 10:36
Added keywords: reliable, server, exec, self.
Added: Instigator, foreach
Added: Begin, End
Added: sleep, GotoState, Goto
@Zinggi
Copy link
Owner

Zinggi commented Feb 17, 2013

Great to see you added some more keywords!
I know that you can change the theme to make it look good, but I want this IDE to be a plug-and-play solution. So an end-user should just download this and have a great IDE without having to customize it to his needs.
This means that I'd prefer the "We could also just designate that color for the section with the least amount of keywords." solution. If you could do that, so that it looks great without having to modify anything, I will definitely include this.
Cheers and thanks a lot!

@Zinggi
Copy link
Owner

Zinggi commented Feb 17, 2013

maybe have a look at the the file from here:
https://github.com/beefsack/unrealscript-sublime

thats the one I'm currently using.

@EliotVU
Copy link
Contributor

EliotVU commented Feb 27, 2013

Why is Vector, Rotator, etc added? They are not keywords but only defined structs within object.uc, imo they shouldn't be highlighted unless you are going to add struct declaration detection and as follows highlight every struct similar to Resharper syntax highlighting!

switched the group starting with class with the group starting with abstract.
@rokit
Copy link
Contributor Author

rokit commented Feb 27, 2013

Ok, I switched some groups around. See if that is any better. Another possibility is to add a tmTheme file to the package. It would be found under Preferences > Color Scheme > UnrealScript.

@rokit
Copy link
Contributor Author

rokit commented Feb 28, 2013

@EliotVU Several "keywords" in the file are not keywords at all. However, I like the fact they are highlighted because they are used so much. SoundCue is technically not a keyword either. It is ultimately up to Zinggi whether or not he wants to use the file which has not been pulled yet. The file he is using now is probably the purist as far as keywords go.

@EliotVU
Copy link
Contributor

EliotVU commented Feb 28, 2013

Okay, thought so. It would definitely be nice if those are detected by the parser as class instead, similar to that of C# where each var declaration highlights the data type as lightblue if that data type is an object reference.

Btw: I have highlighted every possible keyword of UnrealScript for my program UE Explorer, feel free copy the keywords: http://pastebin.com/ZpqXQNBK

@Zinggi
Copy link
Owner

Zinggi commented Mar 1, 2013

So I've tried your newest file and it does really recognize way more keywords than the one from https://github.com/beefsack.
So yours will be used, Thanks! Would it be possible to add the operators too( e.g. += == = ++ *= / and so on...)?

@EliotVU You mean the C# syntax file in sublime? I don't know how it's done, but don't you think it just contains a list of all standard objects?
It would be cool if you could somehow use data collected by my plugin to recognize all Objects, even user created ones, but I don't think its possible.

@Zinggi Zinggi closed this Mar 1, 2013
@Zinggi Zinggi reopened this Mar 1, 2013
@Zinggi
Copy link
Owner

Zinggi commented Mar 1, 2013

ahh, I don't know how this works! I've never used github before. It says "This pull request cannot be automatically merged." Do you know what to do?
If not I could just overwrite my local file with yours and publish this one, but I don't think that's how github is intended..

@Zinggi Zinggi merged commit c97f2e9 into Zinggi:master Mar 1, 2013
@Zinggi
Copy link
Owner

Zinggi commented Mar 1, 2013

Alright, I figured it out, thanks again!

@rokit rokit deleted the patch-1 branch March 1, 2013 21:00
@rokit
Copy link
Contributor Author

rokit commented Mar 1, 2013

I actually spent some time trying to figure out how operators were highlighted. Opened up a few questions on the Sublime forum and Stackoverflow and never got a response. I seriously have no idea how it's done, but if I ever figure it out I'll let you know.

@Zinggi
Copy link
Owner

Zinggi commented Mar 1, 2013

Alright, it's not really a thing, it would just be a nice-to-have.
This probably doesn't help because you probably already tried that, but you might find a hint by looking through other tmLanguage files that have operator highlighting. (such as python)

@EliotVU
Copy link
Contributor

EliotVU commented Mar 2, 2013

@Zinggi No, I'm talking about the C# highlighting in Visual Studio, it does detect whether something is an object and will highlight it lightblue if so.

@Zinggi
Copy link
Owner

Zinggi commented Mar 2, 2013

Ah I thought you meant a Sublime plugin which would have been great. What a pity, this probably means that sublime is not capable of doing that and therefore we can only add some standard classes as "keywords" to mimic that.
Not exactly the same and not how it should be, but I think it's good enough.
And yes, Visual Studio does a great job there. But I have switched from Visual Studio to Sublime for almost every programming task. I just love this editor, especially spiced up with some plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants