VS Code - WML Syntax highlighting

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

VS Code - WML Syntax highlighting

Post by Bitron » November 6th, 2017, 12:39 pm

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
bumbadadabum
Developer
Posts: 1005
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands
Contact:

Re: VS Code - WML Syntax highlightning

Post by bumbadadabum » December 19th, 2017, 7:31 pm

I love you, thanks for making this.

(yes I came back from the dead just to post this)

User avatar
Bitron
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron » December 19th, 2017, 9:42 pm

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
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron » March 1st, 2018, 11:27 am

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
Developer
Posts: 327
Joined: April 24th, 2016, 4:18 pm

Re: VS Code - WML Syntax highlightning

Post by Tad_Carlucci » March 1st, 2018, 3:45 pm

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
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron » March 4th, 2018, 12:05 pm

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
Developer
Posts: 327
Joined: April 24th, 2016, 4:18 pm

Re: VS Code - WML Syntax highlightning

Post by Tad_Carlucci » March 4th, 2018, 1:15 pm

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: 1276
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel » March 6th, 2018, 3:42 am

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.
Maintainer of Steelhive.

User avatar
Bitron
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron » March 10th, 2018, 8:27 pm

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: 1276
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel » March 19th, 2018, 3:40 am

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.
Maintainer of Steelhive.

User avatar
Bitron
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron » March 23rd, 2018, 1:12 pm

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: 1276
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel » March 24th, 2018, 3:26 am

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.
Maintainer of Steelhive.

warmaven
Posts: 1
Joined: March 25th, 2018, 8:33 pm

Re: VS Code - WML Syntax highlightning

Post by warmaven » March 25th, 2018, 8:46 pm

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: 1276
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: VS Code - WML Syntax highlightning

Post by Celtic_Minstrel » March 26th, 2018, 1:01 am

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.
Maintainer of Steelhive.

User avatar
Bitron
Moderator
Posts: 441
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: VS Code - WML Syntax highlightning

Post by Bitron » March 26th, 2018, 7:55 pm

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

Post Reply