If you still have to do development with Classic ASP or VBScript and you want to use Visual Studio Code, you’ll soon find out that even though the code editor was built by Microsoft, there’s no language colorization support for ASP code by default. Fortunately, adding the feature can be done easily using Extensions. So here are the steps to do so:
-
Launch Visual Studio Code and click on Go and select Go to File… or just press CTRL-P.
-
On the dialog box, type in the following:
ext install classic asp
and press [ENTER].Another way to do it, you can just click on the Extensions icon (it should be the last one on the left-hand side (or press CTRL+SHIFT+X) and type in classic asp in the search box.
-
Select Classic ASP by Ilya Verbitskiy and click on the Install button as shown below:
-
Once installed, we still have to associate the asp file extension to the newly ASP colorizer so we don’t have to manually select ASP as the language every time we open an ASP file. As it is now, Visual Studio Code still has no way to detect it as an ASP page so it will treat it as an HTML file.
From the File menu, open Preferences and select Settings (CTRL + ,).
-
In Search settings box, type in “file associations” and you can either click on the Add Item button and populate the Item and Value (option 1), or you can click on link Edit in settings.json (option 2). In the older version of Visual Studio Code, only option 2 was available, but now if you only have a few entries, option 1 would be easier to do.
-
If you chose option 1, after adding the items, if you clicked on Edit in settings.json you should see the following:
"files.associations": { "*.asp": "asp", "*.vbs": "asp", // optional "*.inc": "asp" // optional }
If you chose option 2 though, you have to add those in yourself.
-
Save the file (CTRL-S) and close it.
That’s all there is to it, now you every time you open an asp file (or vbs script for that matter), the selected Language Mode will be set to ASP and any classic ASP code will be colorized accordingly.
This is not limited to ASP only, you can always look for any language of your choice by going to Visual Studio Marketplace.
Further Reading
Adding Language Colorization
How to Reassign Shortcut Key for Column Selection in Visual Studio Code
Download
Visual Studio Code
Classic ASP (Classic ASP Language Support) – Ilya Verbitskiy
Excellent my friend !! Best Regards