Syntax highlighting for domain-specific language in VS2008? - visual-studio

I have a domain-specific language with a certain syntax. Is it possible to make Visual Studio 2008 recognize custom languages in the usual editors? That is, associate a given file extension to a certain syntax-coloring scheme? If so, would you have any pointers as to how to do this?
I'm sorry if this is a duplicate. I searched but couldn't find a relevant answer, and yet it does sound like a simple question.
Regards.

If the Implementing Color Syntax Highlighting in Visual Studio 2008 seems like the deep end, you can download the Lua Lang Pack http://luaforge.net/projects/lualangpack/ and see how they do it.
They use the Compiler Tools in C# which are quite neat.
Failing that you can download my prototype Erlang VS plugin that currently only has simple syntax highlighting, but is based on all the above.

Dervin,
This should help you out:
Implementing Color Syntax Highlighting in Visual Studio 2008:
http://msdn.microsoft.com/en-us/library/bb165041.aspx

Related

adding a new textmate grammar to visual studio 2015 update 1

In the visual studio 2015 update 1 release blog post (https://blogs.msdn.microsoft.com/visualstudio/2015/11/30/visual-studio-update-1-rtm/) the ability to add textmate bundles (or grammars) is explicitly mentioned:
Editor support for new languages. The Visual Studio editor now provides built-in syntax highlighting and basic IntelliSense support for languages including Go, Java, Perl, R, Ruby, and Swift. We support the TextMate bundle
model for language grammars and snippets, allowing you to extend this with support for other languages.
I want to create a new textmate grammar for my own language, but I cannot find any documentation, how to do this in vs2015 update 1.
The best source I found is this reddit conversation: https://www.reddit.com/r/programming/comments/3uvwn3/visual_studio_2015_update_1/
It looks like it's implemented as an extension, "Visual Studio Extension for Textmate Grammars." If you search for *.tmbundle in your visual studio\Common7\IDE\Extensions directory you will find the location of the tmbundles. I just made a new folder for Julia and copied the Julia tmbundle to it. Seems to work.
Is this the supported way of doing this? Why isn't there any documentation, visual studio menu etc. for this?
You can do this the way you've done it above, or if you prefer it to be in your user profile directory rather than across the whole operating system installation, you can add the bundle here:
%USERPROFILE%\.vs\Extensions\
On most machines, that path expands to:
C:\User\<yourusername>\.vs\Extensions\
Looks like there's an extension from Mads Kristensen now that provides a large number of TextMate syntaxes into Visual Studio. Looks like it's easy to add additional languages as well... You can probably check out the repo and see exactly what's required to add additional syntax.
http://vsixgallery.com/extension/4773ce75-6f30-4269-9557-1f7c30a47be2/

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.

Syntax coloring for VBS file in Visual Studio with a different extension

A program we work with in my office can be automated through VBScript Files, yet the files are saved with an extension *.RVB other then *.VBS. I'd like to use Visual Studio as my editor/debugger, which is working. Yet it is not coloring the code like it does if I have a *.VBS file open.
Under Tools->Options->File Extension I added "RVB" and set it's editor to Microsoft Visual Basic, yet it is still not applying any syntax highlighting to my file. What am I missing?
I realize this might be beyond what you had in mind. However, I see no acknowledgement to your solution so I am going out on a limb here. You could create a language extension and totally control all aspects of the coloring. This is easily transfered to 2010 (the example is in 2008) but remains relevant.
http://msdn.microsoft.com/en-us/vstudio/bb851701
In this video, Hilton Giesenow illustrates a simple working Language Service. He begins by building a simple scanner colorizingsing based on regular expressions, then expands on this to implement the Managed Babel framework, integrating MPLex and MPPG directly into the Visual Studio build as well.

Does Visual Studio have an option to generate html documentation for Javadoc-style comments?

Does Visual Studio have an option to generate html documentation for Javadoc-style comments? If so, what steps are necessary to accomplish this?
In BlueJ there is an option to translate Javadoc-style comments into an html file.
Like the following picture shows for Java using BlueJ I want to do the same with Visual Studio :
(source: time-tripper.com)
Do you actually mean JavaDoc, in Java? If so, I don't believe so - just use javadoc itself. Visual Studio doesn't really support Java.
If you mean C# XML documentation comments, then you can change the project properties to build the XML file, and then use NDoc (discontinued) or Sandcastle to build HTML (or chm etc). It's not as easy as it might be, admittedly.
EDIT: If you're using C++, you should probably look at Doxygen. There may be Visual Studio plugins, but you may be best off just running Doxygen as part of your build process. If you're using C++/CLI there may be some equivalent of C# XML comments, but I don't know of it.
You can use a Javadoc-compatible commenting style, either entering the comments by hand, or use my addin, Atomineer Pro Documentation to take most of the work out of it. Then to generate external documentation, use doxygen, which reads javadoc happily.
The alternative is (as Jon has said) to use XmlDoc format comments, which can be used by Visual Studio (for intellisense tooltips), Atomineer, Sandcastle and Doxygen. It's a less human-readable format, but gives you significant advantages within the Visual Studio environment, so it's a bit more flexible.
Both approaches will work for C#, C++, C (although C# works better on the intellisense side of things)

Is there a way to force Visual Studio 2008 (or below) to use a spellchecker for comments?

I'm not sure if this can be done at all, but it'd certainly make my life easier. I was wondering if maybe the MS spellchecker could be used as a plug-in for other applications... or something like that.
Thanks.
You can do it via this free add-in.
Newer post
Visual Assist from Whole Tomato comes with a Spell Checker, along with many other wondrous productivity enhancing features - if you're using Visual Studio without Visual Assist you're really missing out :)
You could use FXCop and write a custom rule to spellcheck (link) your comments
Well, I don't know about Visual Studio, but both Eclipse and Emacs have support for spellchecking inside comments. I usually have it off, because it too often gets in the way and complains about things like variable names, but then I don't really need a spellchecker (most of the time).
There is a tool for automatically correcting typical typos everywhere you type:
AutoHotkey and the AutoCorrect for English Script

Resources