VS Code - WML Syntax highlighting
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.
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: VS Code - WML Syntax highlightning
I just noticed that it doesn't seem to hilite augmentation tags correctly? Like
There also seem to be a few (very minor) bugs with the automatic indent/outdent. In particular, tags in comments count when it's deciding whether to indent, and placing the closing tag on the same line as the opening tag still outdents. I also had it break entirely at one point and had to disable/re-enable the extension to get it back, but I have no idea how to reproduce it.
[+units]
and such.There also seem to be a few (very minor) bugs with the automatic indent/outdent. In particular, tags in comments count when it's deciding whether to indent, and placing the closing tag on the same line as the opening tag still outdents. I also had it break entirely at one point and had to disable/re-enable the extension to get it back, but I have no idea how to reproduce it.
Re: VS Code - WML Syntax highlightning
Well, all I did to have the indentation work was this:
Unfortunately I really have no idea how to fix that.
About the
Code: Select all
"indentationRules": {
"increaseIndentPattern": "\\[([_A-Za-z0-9]*)\\]",
"decreaseIndentPattern": "\\[\\/([_A-Za-z0-9]*)\\]"
}
About the
[+units]
, I there should be a way to fix it, but I haven't found it yet.Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: VS Code - WML Syntax highlightning
Hmm, what about adding
^\\s*
to the beginning of both patterns? I think that might fix most of the indent bugs, though it may still indent if you type [tag][/tag]
on one line...Re: VS Code - WML Syntax highlightning
Code: Select all
"indentationRules": {
"increaseIndentPattern": "^\\s*\\[([_A-Za-z0-9]*)\\]",
"decreaseIndentPattern": "^\\s*\\[\\/([_A-Za-z0-9]*)\\]"
}
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: VS Code - WML Syntax highlightning
That's what I proposed, yeah. I think it should work provided that those patterns match only a specific line.
Re: VS Code - WML Syntax highlightning
Alright, then. It's updated. :)
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: VS Code - WML Syntax highlightning
Just uploaded another small update. Version 1.0.5 adds `#ifhave` and `#ifnhave` to the recogniced syntax.
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: VS Code - WML Syntax highlightning
Which reminds me, are #arg and #endarg supported yet?
Re: VS Code - WML Syntax highlightning
Yes I think so. Lemme check.
Edit: yep, they are.
Edit: yep, they are.
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: VS Code - WML Syntax highlighting
This might be asking for a lot, but I wonder how difficult it would be to add outline support? I'm thinking of something kinda similar to the JSON outline support... or maybe just note the tag hierarchy? Though it'd also be awesome to have special support for event tags, and perhaps a few other common tag types - for example, listing the event's name and ID in the outline.
Re: VS Code - WML Syntax highlighting
I think that's a bit above my skills, at least currently, but surely an interesting idea.
I will add a note to the maybe-in-future-features. :)
Recognizing syntax errors is on top of that list.
I will add a note to the maybe-in-future-features. :)
Recognizing syntax errors is on top of that list.
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: VS Code - WML Syntax highlighting
$variables could use separate color.
Re: VS Code - WML Syntax highlighting
True. Should be able to make it next week.
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: VS Code - WML Syntax highlighting
Hey,
I installed it, but I don't know how to activate it properly.
All other syntax highlighter for python, cpp and so on are automatically activated when opening a .py or .cpp file, but the WML extension is not.
I installed it, but I don't know how to activate it properly.
All other syntax highlighter for python, cpp and so on are automatically activated when opening a .py or .cpp file, but the WML extension is not.