Zinggi / UnrealScriptIDE

Auto-completion, Syntax Highlighting, Go to Declaration, Build and Run and more..
Other
90 stars 19 forks source link

Create UnrealScript.tmLanguage #1

Closed rokit closed 11 years ago

rokit commented 11 years ago

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

Zinggi commented 11 years ago

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 commented 11 years ago

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

Zinggi commented 11 years ago

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 commented 11 years ago

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!

Zinggi commented 11 years ago

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 commented 11 years ago

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

thats the one I'm currently using.

EliotVU commented 11 years ago

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!

rokit commented 11 years ago

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 commented 11 years ago

@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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

Alright, I figured it out, thanks again!

rokit commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

@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 commented 11 years ago

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.