Ruby syntax highlighting in visual studio 2012 - ruby

I use rake scripts for running builds and would like to be able to get syntax highlighting within visual studio.
Is it possible to get ruby syntax highlighting in Visual Studio 2012?
I've been searching for a while but not come up with a solution yet. I'm only looking for free solutions so Ruby In Steel is out.
Vote here for IronRuby support for visual studio 2012

Unfortunately the IronRuby tools for Visual Studio don't yet support VS2012.
I might be wrong about that though, it seems that the development has been moved to Github.
My preferred external editor is Sublime Text so I've opted use that for Ruby files. You just right click on your rakefile.rb is the VS solution explorer and choose "Open With". In the dialog you can add an editor of your choice and set it to be the default.

There was, at one point in 2008 anyway, a free edition of Ruby in Steel and it seems like the download link on that page does still work. It has a slightly limited feature set compared to pay versions of the software, but does include syntax Highlighting. So have a go and see if that will do what you need for free.
And for the rest of you, Neil specifically asked for VS internal syntax highlighting, not for you to plug your favorite text editor.

Related

Enabling opening and closing tag guidelines in Visual Studio

I've recently started using Visual Studio quite heavily since starting to develop in .Net
I really like the intellisense as it increases my productivity by allowing me to code faster. Previously when authoring CSS I would just use Notepad ++ and I got very used to some of the little features that this awesome text editor possessed however, now that I am doing the bulk of my work in Visual Studio 2013 I want to try and avoid having too many environments open at once. With this in mind, there is one feature inparticular that I would like to try and replicate in Visual Studio when editing CSS or indeed any other type of code.
In Notepad ++ it automatically includes a sort of guideline which runs down the page between the opening and closing tags of elements as shown below:
My question is, how do I replicate this behaviour in Visual Studio 2013 as the currently setup I have at the moment isn't as clear/productive as you can see below:
Any help would be greatly appreciated.
There are a couple of free extensions you can use to do this. These will run on any of the Visual Studio versions except Express, which does not support extensions.
You can duplicate this with the Indent Guides extension.
You can also use the Structure Visualizer Feature of the Productivity Power Tools.
Note: The backgrounds in the example are different because they are taken on different machines with different themes.

Add a new language to Visual Studio 2010 with syntax highlighting and intellisense

I am trying to add support for a different language in Visual Studio 2010. I was hoping to add custom syntax highlighting, and have some sort of basic intellisense work with it. The language I am trying to add is 4Js Genero (a newer version of Informix-4GL). I basically just need support for the .4gl and .per file extensions that are used in Genero/4GL. Does anyone know how to do this, or can point me in the right direction?
It's not really for the faint of heart. Don't underestimate how much work you'll have to put in.
You'll need the Visual Studio 2010 SDK, and then to read (and re-read, and re-read(*)) all about Language Services
The purpose of a language service in Visual Studio is to provide language-specific support for editing source code in the integrated development environment (IDE). You implement a language service as part of a VSPackage.
(*) - unless it all immediately makes sense to you.
This isn't an answer on how to create custom syntax highlighting.
There is an open-source extension for visual studio 2010+ for Genero 4gl language support out of github:
https://github.com/gregfullman/VSGenero/wiki
It should do most of what you're looking for already, and it would certainly make a great starting point for you if you want to do more.

"Scope Highlight" feature in Visual Studio? (same as seen in BlueJ for java)

I would like to know (as I've failed so far in finding such a feature in the VS's options),
if there is a feature which allow for scope highlighting same as seen in the BlueJ IDE for java,
here is an example:
Note how the code blocks are all highlighted with color,
when learning java using blueJ i found it to be extremely easy on the eye when looking at code,
and everything felt a lot more organized,
moving to C# and working on MS visual studio, its all text with some highlighting, Class names, keywords etc etc,
but in general it still feel like a black text on a white background and lacking that organized feeling i sorely miss from blueJ,
i noticed there is a similar question here referring to eclipse,
Eclipse IDE Scope Highlighting?
just to be on the safe side, ill ask again referring to Visual studio,
is there such a feature in VS? is there an add-on \ plugin for VS which allows it?
Thanks in advance for your answer.
Microsoft provides a free Productivity Power Tools extension for Visual Studio 2013 and 2015. This has a "Structure Visualizer" feature similar to the CodeRush plugin. Both are more subtle than the BlueJ style, but should make scopes a little clearer.
Productivity Power Tools 2013
Productivity Power Tools 2015
Update
Visual Studio 2017 integrated a version of this into the core application for C#, Visual Basic, F#, and XAML (as Structure Guide Lines). However, C++ still requires an extension.
Look at the DevExpress CodeRush plugin, there is a 30-day trial version.
The function it provides is called "Structural highlighting", and I think its even better than what you want (and its customizable).
CodeRush Express
CodeRush Documentation

Is there a Perl extension for Visual Studio?

Does anyone know if there is an extension or plugin for Visual Studio ( any version ) that will recognize Perl syntax highlighting? I want to edit the Perl files in my vs projects, but it gets hard to read sometimes. Thanks.
Old Answer (still applies unless you are using Visual Studio Update 1 RTM (2015) or later)
In short. No, there doesn't seem to be a good plugin for it.
If you use Perl rarely, I would recommend sticking with Visual Studio for Microsoft languages and Padre for Perl.
However, if you use Perl as much or more than Microsoft languages, you might want to check out Emacs, which has support for C#, VB.NET, and Perl. Emacs is designed to be a "one-stop-shop" for all you do all day long, including browsing the web. You can come into work, start using Emacs and never have to leave it until it is time to go home.
disclaimer: The answer above is geared toward the Original Poster. I'm a big fan of vim. Personally, if I were thrust into a situation where I had to work with C# and Perl on the same project, I would get ViEMU for Visual Studio and then use two editors: Visual Studio for C# and vim for Perl.
If this is something you are willing to spend some time on, check out defining your own syntax highlighting for Visual Studio.
Visual Studio Update 1 RTM now (2015) has Perl support, along with Go, Java, R, Ruby, and Swift.
Komodo Edit is quite nice, and free. code folding and other good stuff.
A work-in-progress Visual Studio extension for Perl6 (not the Perl5 asked by the OP) is incrementally more full-featured. It is released under the MIT License and its repository is on GitHub. As a prerequisite, Perl6 (e.g., Rakudo) needs to already be installed.
For Perl syntax highlight ext install perl6
Install this extension To Run Perl and Other languages
A workaround for Visual Studio desktop version is to use C++ syntax highlighting.
Go to Options -> Text Editor -> File Extension
Enter extension "pl" (no dot)
Assign it to "Microsoft Visual C++"
Click "Add"
If necessary, repeat the same steps for "cgi" extension.

Ironruby IDE

Which IDE if any, are people using to develop Ironruby in?
If you are looking for an integrated Visual Studio editor, with intellisense etc, Microsoft has nothing in plan yet (according to this article with John Lam -> http://www.infoq.com/articles/state-of-ironruby). But there is an integrated editor which works pretty good - SappireSteel - at http://www.sapphiresteel.com/Ruby-In-Steel-For-IronRuby.
If you just want to edit in VS and don't care about intellisense and such, you could try and set up an external tool from within VS and call the ir.exe (http://msdn.microsoft.com/en-us/library/68c8335t%28VS.80%29.aspx)
There are numerous editors with support for ruby highlightning which you can try out as well, but there is no one (I think) with intellisense-like support for the .NET framework. Scite (http://www.scintilla.org/SciTE.html) is pretty popular, Scott Hanselman blogged about Ruby support/highlightning in Notepad2 (http://www.hanselman.com/blog/NewNotepad2WithRubySyntaxHighlighting.aspx). On Codeplex you can find a tool called IronEdit (http://www.codeplex.com/IronEditor) which I've not tried myself yet.
I ran RubyMine (http://www.jetbrains.com/ruby/index.html) for a while, which seems to be a really good Ruby IDE (costs money), but doesn't have any specific support for IronRuby. I hope the JetBrains will release something which plugs into Visual Studio eventually...
Personally I think Sapphire will come up with something really good eventually. I hope this helps.
I use Vim as my IDE with some custom settings that I blogged about some time ago.
Visual Studio?
According to the IronRuby website Visual Studio C# Express can be used (and in turn, any commercial version of Visual Studio 2005+ I'll assume).
From the IronyRuby.net home page:
Today, you must check the source code out of the IronRuby Subversion repository on Rubyforge. You will need a Subversion client: we recommend TortoiseSVN. To build the sources from the command line, you must also have Ruby installed on your computer already: we recommend the Ruby one-click installer. You can also build the sources using Visual Studio; if you don't already own a copy, you can download a free copy of Visual C# Express 2008.
Ruby in Steel from Sapphire Steel is build on the Visual Studio Shell (integrated mode) that will merge with Visual Studio 2008 if you already have it installed or simply be a standalone installation if you don't have Visual Studio already installed.
Also, no use to you, but Microsoft are going to be releasing IronRuby Studio (and IronPython Studio) at some point in the future. I couldn't find much about these on the web though - they were mentioned by a speaker at Teched Europe a few weeks ago.
You might interested in IronEditor. which similar to SciTE. get it at http://www.codeplex.com/IronEditor
Sapphire has a version now specifically targeted at IronRuby. Furthermore, not only is the alpha free now but they claim production will be free as well.
edit:forgot to include linkage
IronRuby integration in VS2010 can be found here: http://ironruby.net/tools/
The IronRuby tools are a good place to start but I think the best IDE for doing Ruby or in more detail Rails is VIM. by using a plugin such as rails.vim you can keep all your shortcuts and scripts across the boundaries such as Windows / Linux or IronRubyOnRails / RubyOnRails ...
JetBrains is offering a great IDE with RubyMine. I can remember that I've read an article about how to configure RubyMine to support IronRuby.
But as already mentioned IronRuby Tools for VS2010 are a good place to start.
The current version(s) of IronRuby now contain Ruby Tools for Visual Studio, which install along with IR itself. This is true for versions 1.1 and later.

Resources