VS Code - WML Syntax highlighting

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

VS Code - WML Syntax highlighting

Post by Bitron »

This is a simple WML syntax highlighter for Microsofts Visual Studio Code editor.

You can find both syntax support and color theme in the Visual Studio Marketplace or direclty in the editor's plugin tab. Just search for "wml" and you will find both syntax support and color theme. :)

Image
User avatar
Astoria
Inactive Developer
Posts: 1007
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: VS Code - WML Syntax highlightning

Post by Astoria »

I love you, thanks for making this.

(yes I came back from the dead just to post this)
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron »

I'm glad to hear it is appreciated and you are welcome.
Feel free to tell if there is anything missing or you would like see additional features. :)
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron »

I am happy to announce that I somehow managed to register both extentions to the visual studio marketplace!
You can download them directly from there now, getting updates quicker and such. Woho!
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: VS Code - WML Syntax highlightning

Post by Tad_Carlucci »

Is it possible to add an icon? I use vscode-icons and, of course, .wml files show as the default 'blank page of paper' icon. Maybe a tiny copy of the game logo?

Nice. The .cfg files also are recognized.

I don't do WML a lot these days, but it's nice to have when I do.
I forked real life and now I'm getting merge conflicts.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron »

Unfortunately it does not seem possible now to add an icon for a custom language. At least I haven't found a way yet.
Though, I'll look out for that in future. I guess I'd use wesnoth' favicon.
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: VS Code - WML Syntax highlightning

Post by Tad_Carlucci »

I have a feeling if you submitted a PR with one to the icons project it'd be accepted. 'cfg' might be too common but 'wml' surely is unusual enough for them to consider adding it.
I forked real life and now I'm getting merge conflicts.
User avatar
Celtic_Minstrel
Developer
Posts: 2343
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel »

Small bug: comments aren't highlighted as comments unless there's a space after the #.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron »

That was actually intended in the beginning to force myself a little to use this convention. I hadn't thought about sharing the addon with others at this point. I can change it though, if you want.

EDIT: Fixed
User avatar
Celtic_Minstrel
Developer
Posts: 2343
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel »

I've noticed that, when coding in Lua in VS Code, it automatically de-indents when I type "end". Is it possible to do this for WML when I type "[/"? I'm not sure if that's in scope for a syntax hiliter, but I figure it can't hurt to ask.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron »

I had a look into it and it was fairly simple to implement, so I kicked out version 1.0.3 with that change. Now it automatically indents after an opening tag and it will automatically deindent closing tags like this:

Code: Select all

[tag]
---->
<----[/tag]
User avatar
Celtic_Minstrel
Developer
Posts: 2343
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel »

Where do I get v1.0.3? I don't see it in the opening post?
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
warmaven
Posts: 1
Joined: March 25th, 2018, 8:33 pm

Re: VS Code - WML Syntax highlightning

Post by warmaven »

The extension is available on the VSCode marketplace: https://marketplace.visualstudio.com/it ... Bitron.wml (the related color theme is here: https://marketplace.visualstudio.com/it ... noth-theme). Source code is at https://github.com/Byteron/wml.
User avatar
Celtic_Minstrel
Developer
Posts: 2343
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel »

Ah, I missed the part where it was added to the marketplace. The indenting thing is nice, thanks!
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron »

Thank you for the quick help, warmaven.
I updated the initial post to prevent confusions in future.
Post Reply