ManiaScript for Visual Studio Code

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

tonechild
Posts: 11
Joined: 20 Mar 2017, 12:43

ManiaScript for Visual Studio Code

Post by tonechild » 20 Mar 2017, 12:54

Image
https://github.com/MattMcFarland/vscode-maniascript

Hi all, just released this and thought you might find it very helpful. I actually rewrote the grammar files so that IDEs can get a lot more information from the code. I'm planning on adding autocompletion/intellisense soon and snippets soon as well.

You can install it by searching and installing the extension called `vscode-maniascript`

EDIT: Version 1.1.2 released as of 3/27/2017:

Image

You can get a copy of this extension for VSCode here: https://marketplace.visualstudio.com/it ... aniascript
Last edited by tonechild on 27 Mar 2017, 10:54, edited 2 times in total.

User avatar
Chris92
Translator
Translator
Posts: 912
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: ManiaScript for Visual Studio Code

Post by Chris92 » 21 Mar 2017, 15:32

That's actually pretty neat, thanks for that!
Image

Maintainer of AdminServ - Follow @AdminServ on Twitter!
Check out my Personal Twitter account!

oiram456
Posts: 611
Joined: 11 Oct 2010, 08:30
Contact:

Re: ManiaScript for Visual Studio Code

Post by oiram456 » 21 Mar 2017, 17:35

Great one, thanks! Looking forward for the other features :)
Specs: Windows 7 Home Premium 64-bit SP1 | Intel Core i5 2500K @ 3.30GHz | 4,00GB Dual-Channel DDR3 @ 668MHz (9-9-9-24) | ASUSTeK Computer INC. P8Z68-V (LGA1155) | 1920x1080@60Hz|2047MB NVIDIA GeForce GTX 560

reaby
Posts: 866
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: ManiaScript for Visual Studio Code

Post by reaby » 23 Mar 2017, 15:14

Wooaaaaaaaah, this is what's been missing!!! and ofc warm welcome to forums :)

I tried to write grammar multiple times, and I've endup each time having massive headache and even not close to working grammar.
Big kudos tonechild :thumbsup: :thumbsup: :thumbsup: :thumbsup: so cool. sooo cool to finally have ide support.

Question:
Would you be extra kind to provide also native .tmLanguage ruleset for other ides which supports it :thx: ?

So cool. Wow. :3 :3

tonechild
Posts: 11
Joined: 20 Mar 2017, 12:43

Re: ManiaScript for Visual Studio Code

Post by tonechild » 23 Mar 2017, 16:36

Hey!

So glad this is helping others!

To answer the question regarding native tmLanguage support - This should be availble for use with any language using .tmLanguage format.

Because .tmLanguage files are difficult to maintain, I have created a build script that builds smaller and organized YAML files into the standard .tmLanguage format. You can see this here: https://github.com/MattMcFarland/ManiaScript.tmLanguage

You should be able to easily port these to other editors, but let me know if that is not the case, and if something is missing!!!

ALSO, I've just released 0.3.0 today with the following changes:

Added label support +++Foo+++ / ***Foo*** ... ***

Image

---

Added Template String script tag support

Image

---

Added String Format support (<$1>)

Image
Last edited by tonechild on 23 Mar 2017, 18:40, edited 1 time in total.

reaby
Posts: 866
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: ManiaScript for Visual Studio Code

Post by reaby » 23 Mar 2017, 16:48

tonechild wrote:
23 Mar 2017, 16:36
To answer the question regarding native tmLanguage support - This should be availble for use with any language using .tmLanguage format.

Because .tmLanguage files are difficult to maintain, I have created a build script that builds smaller and organized YAML files into the standard .tmLanguage format. You can see this here: https://github.com/MattMcFarland/vscode ... c/syntaxes

You should be able to easily port these to other editors, but let me know if that is not the case, and if something is missing!!!
So I tried, and failed already :)

If I do direct YAML to XML it's wrong format and doesn't work :(

direct yaml-to-xml:

Code: Select all

<?xml version="1.0"?>
<plist><fileTypes><item0>Script.txt</item0></fileTypes><firstLineMatch>#RequireContext</firstLineMatch>
and the way it should be:

Code: Select all

<plist version="1.0">
<dict>
	<key>fileTypes</key>
	<array>
		<string>Script.txt</string>
		<string>txtm</string>
	</array>
	<key>firstLineMatch</key>
	<string>#RequireContext</string>
BUT
I found vscode plugin to do transform for the files easily, but it fails to install since I have only community edition of visual studio.
https://github.com/Togusa09/vscode-tmlanguage/releases

tonechild
Posts: 11
Joined: 20 Mar 2017, 12:43

Re: ManiaScript for Visual Studio Code

Post by tonechild » 23 Mar 2017, 16:54

I wasn't aware you could use vscode extensions for vs?

AFAIK visual studio code is different than visual studio. vscode is 100% free for one :)

THe YAML files are using a custom builder, so you would have to use node, then npm install, then npm run build to create the official .tmLanguage files. Have you tried that? They are not in the github repo (only src files are)

the npm build script converts using the same libraries that plugin you mentioned uses to convert, in fact I used the source from that plugin as inspiration for my build script. (they used a lot of verbose code tho I did it in by far less lines)

Observe: https://github.com/Togusa09/vscode-tmla ... #L147-L170

The 2 libraries: yamljs and plist are used to convert the yaml files, which I use here: https://github.com/MattMcFarland/ManiaS ... js#L14-L17

Which give the exact same results :)

You can use the following commands to build the .tmLanguage files - please make sure you have nodejs isntalled first

Code: Select all

# in BASH command line interface:
npm install
npm run build
Then you should see the portable .tmLanguage files in the /syntaxes directory.

I hope this helps!
Last edited by tonechild on 23 Mar 2017, 18:40, edited 2 times in total.

reaby
Posts: 866
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: ManiaScript for Visual Studio Code

Post by reaby » 23 Mar 2017, 17:01

ye, trying it now.
I missed the build script earlier. Thanks for clarification!

tonechild
Posts: 11
Joined: 20 Mar 2017, 12:43

Re: ManiaScript for Visual Studio Code

Post by tonechild » 23 Mar 2017, 17:04

Yea! The build script does make things a little bit less transparent - so I may add some documentation around this in the contributing section so others can easily see how this works.

I was also thinkinf of removing the .tmLanguage build script alltogether from this repo, and creating another repo that is generic and just creates the .tmLanguage file - then other plugins (like the vscode) plugin can pull that lib in as a dependency. I'm not sure though, just thinking atm.

tonechild
Posts: 11
Joined: 20 Mar 2017, 12:43

Re: ManiaScript for Visual Studio Code

Post by tonechild » 23 Mar 2017, 18:42

1.0.0 Release!

Major deal, but small changes.

I've removed the tmLanguage build process from the vscode extension itself, because I plan on reusing it for the atom editor, and I think there should be a single source of truth for tmLanguages

The tmLanguage repo is here: https://github.com/MattMcFarland/ManiaScript.tmLanguage

The vs plugin now just installs the tmlanguage repo from npm as a dependency.

Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest