Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Visual Studio for custom script language

We are using a commercial software that has its own scripting language with which you can customize the product. It is very tedious to write code in it without any help from an IDE and it has its own compiler.

Is it possible to use Visual Studio and create an environment for me to write scripts in this language and get the help of intellisense and syntax highlightning and other good things you find in an IDE? Ideally I would like to bind a button in VS to launch the external compiler and compile the code so I don't have to switch windows all the time as well.

If this is possible is it a very hard thing to accomplish?

like image 357
Kneta_ Avatar asked Jun 05 '26 16:06

Kneta_


1 Answers

Yes, this is certainly possible. You need to create a Visual Studio Shell add-in with custom language services and text editors. You need to install the appropriate Visual Studio SDK and then you'd continue to:

  • Create a custom Editor and/or designer
  • Add a language service
  • Add Project and Item templates

You're allowed to ship Visual Studio Isolated Shell with your application (license required and there are some limitations) so that your users don't need to have Visual Studio Professional installed.

There are a number of open-source projects that provide a custom editor, language services etc in Visual Studio, these could provide a nice place to research how things are done, next to teh Visual Studio SDK documentation:

  • PyTools, which is a Visual Studio editor for IronPython
  • Phalanger, which contains a Visual Studio editor for PHP
  • PoShTools, a Visual Studio service for PowerShell editing right inside Visual Studio

You'll probably want to dig into MsBuild as well, since Visual Studio will expect you to create a project file if you want to edit a collection of files and compile them. MsBuild could in turn call your own compiler, like it calls csc to compile C# code for example.

  • Creating Project Types
like image 196
jessehouwing Avatar answered Jun 10 '26 18:06

jessehouwing



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!