Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Registering extension EJS with visual studio and intellisense?

does anyone know how i can map EJS to visual studio to act like a HTML file. I think i managed to do it but its got a lot of bloat in it.. Its basically an HTML file without the HTML and BODY tags.. so i selected the UserControl in VS 2008, tools, options, Text Editor, file extension and added EJS and added it as usercontrol.

If i choose html then it doesn't offer intellisense until it detects a HTML and BODY ..

My question really is can i add to this list? and create my own?? It need to offer intellisense for html and javascript but nothing more.

Also can i create some kind of code to install the EJS automatically on another pc?

like image 969
mark smith Avatar asked May 27 '09 10:05

mark smith


2 Answers

For what it is worth at this point...

The above solutions are still valid. However an easier solution (that I have only tested in VS 2013), is to right-click any given *.ejs file, and Select "Open With". In the dialog that opens, select "HTML (Web Forms) Editor" and select it as default.

Now, when you open your EJS files, you will get syntax highlighting and intellisense for your HTML. This does not give you support for EJS Code snippets.

like image 79
Rex Whitten Avatar answered Sep 18 '22 16:09

Rex Whitten


I was also searching for an answer to this question. Here is what I found...

Source - Visual Studio 2008

Obviously Visual Studio does not have support for the .blogtemplate extension. For awhile I hacked my way around it by renaming the files to have a html extension while editing, which sort of works. The main problem is that I keep forgetting to change the extension back before I start testing my changes - so this was causing unnecessary pain... I had a vague memory of configuring something like this before and found these instructions. For the sake of completeness I include them here also:

  1. Go to the Tools->Options menu.
  2. Pick Text Editor -> File Extension from the tree in the left part of the Options dialog.
  3. Type your file extension, .blogtemplate in my case, in the Extension text box.
  4. Select the appropriate editor from the Editor dropdown.
  5. Click Add and then Ok to close the dialog and re-open your files.
like image 45
Bennett Dill Avatar answered Sep 18 '22 16:09

Bennett Dill