• Welcome to Dark Bit Factory & Gravity.
 

LUA Language plugin for Visual Studio 2012

Started by Raizor, October 26, 2012

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Raizor

I've been doing some LUA work recently and have also upgraded to Visual Studio 2012. Unfortunately, there's no LUA plugin for VS 2012 to support syntax highlighting etc. I decided to have a go at porting VSLua over to VS 2012 and it's worked well.

I've attached the extension to this post in case anyone else would find it useful.

Cheers,

Raizor

EDIT: I've also attached the source to this post too.
raizor

Challenge Trophies Won:

Kirl

Hey how did you come upon Lua? :)
I played around with it a bit on Codea on the ipad and really quite like it.

K++ of course! :)
www.kirl.nl
Challenge Trophies Won:

Raizor

Quote from: Kirl on October 26, 2012
Hey how did you come upon Lua? :)
I played around with it a bit on Codea on the ipad and really quite like it.

K++ of course! :)

It's used in Fnuque's 64k intro tool for a lot of the GUI stuff. It saves time and hassle by avoiding having to recompile the C++ code each time changes are made. That's the theory anyway :)

It's certainly taking some getting used to as it's quite different from any language I've used before. The whole .. string concatenation and -- comments keep catching me out. I was having a hard time without a syntax highlighter, so that's why I decided to have a go at porting it. It doesn't populate the navigator bar in Visual Studio, which when using C#, C++ etc lists all the functions/methods/objects in the current class and makes it really easy to navigate code. Not the end of the world, but I still miss that when using Lua. Lua is starting to grow on me though, albeit it slowly, like a fungus :)

I still haven't got around to playing with Codea, it sounds like you guys are having some good fun with it, so it would be good to check it out at some point. Is it possible to export/import/share code with it?
raizor

Challenge Trophies Won:

Kirl

Quote from: Raizor on October 26, 2012
I still haven't got around to playing with Codea, it sounds like you guys are having some good fun with it, so it would be good to check it out at some point. Is it possible to export/import/share code with it?
You need to copy-paste code manually, there is a link to codea's forums in the main menu, but that's it. The project sharing feature was pulled on Apple's request, because the the free sharing of programs might just undermine the app store. 
Apple... :diablo: 

Would be cool if you joined in! :)
www.kirl.nl
Challenge Trophies Won:

EpikYummeh

Thank you very much! This works great; if only it was easier to create IntelliSense support for such a loosely typed language.

I had seen the 2010 version plugin and was hopeful it would work, but here I am! Great work!
C# - JavaScript - XHTML/CSS - RBX.Lua

Raizor

Quote from: EpikYummeh on November 29, 2012
Thank you very much! This works great; if only it was easier to create IntelliSense support for such a loosely typed language.

I had seen the 2010 version plugin and was hopeful it would work, but here I am! Great work!

No worries EpikYummeh, glad it's proved useful. I did give intellisense some thought, but as you mention, it's a bit of a can of worms with a loosely typed language and not exactly quick to implement. The syntax highlighting is proving enough for me - for now ;)

Thank you for the feedback, and welcome to DBF :)
raizor

Challenge Trophies Won:

EpikYummeh

Have you heard of SublimeText? They actually have a primitive version of IntelliSense with variable name completion that works for Lua.

The only way I could see getting that to work is adding every identifier or block of text that is not in the list of language clauses and control structure keywords and not a string, but then you have to take into account lexical scope and it could get a bit messy from there. I haven't poked around with how IntelliSense works, but it may be easier than I'm thinking.
C# - JavaScript - XHTML/CSS - RBX.Lua

Raizor

Quote from: EpikYummeh on November 30, 2012
Have you heard of SublimeText? They actually have a primitive version of IntelliSense with variable name completion that works for Lua.

The only way I could see getting that to work is adding every identifier or block of text that is not in the list of language clauses and control structure keywords and not a string, but then you have to take into account lexical scope and it could get a bit messy from there. I haven't poked around with how IntelliSense works, but it may be easier than I'm thinking.

No, I've not come across that before. It does look quite interesting. I really would like a solution that slots into Visual Studio though, and that doesn't look like it does. Worth a go though, thanks for pointing it out :)
raizor

Challenge Trophies Won:

EpikYummeh

Yeah, it has its ups and downs. I've only found it useful for Lua, but I definitely prefer Visual Studio to any other editor I've used, though.
C# - JavaScript - XHTML/CSS - RBX.Lua

zid

thanks for the port - works like a charm.

kennethm

Thanks very much for the port.  It worked well for me.

Raizor

kennethm, zid, I'm glad it was useful for you :)
raizor

Challenge Trophies Won:

serializer

Thanks also, I registered to download this as there doesn't seem to be anything else around for VS2012. Doing some work on an open source game trying to knock some sense into an 8000-line Lua script which was starting to hurt without colour coding :)


Raizor

Quote from: serializer on January 18, 2013
Thanks also, I registered to download this as there doesn't seem to be anything else around for VS2012. Doing some work on an open source game trying to knock some sense into an 8000-line Lua script which was starting to hurt without colour coding :)

You're most welcome Serializer :)
raizor

Challenge Trophies Won:

denghe

good job !!! thank you very much !!!  :updance:

Raizor

raizor

Challenge Trophies Won:

dcga

Thank you so much for this!
Have you considered sharing the source code in case someone wants to add more features to the language service?

Raizor

Quote from: dcga on January 31, 2013
Thank you so much for this!
Have you considered sharing the source code in case someone wants to add more features to the language service?

No worries dcga :) I've attached the source to the first post in this thread in case anyone wants it.
raizor

Challenge Trophies Won:

malchezor

Thank you very much its really useful!

RiC0MD

Thx very much for this, was looking for something to base a quick personal project on, and this fits the bill.