mici37000
mici37000

Reputation: 141

Underscore.js syntax highlighting in Visual Studio 2015

I work with underscore.js templeting engine in html files (look at attached example). My purpose is to make VS highlight js code in html file in addition to regular html highlighting.

<div>
<%
var isRelevant = hasInternetService;
var hasTestResults = _.has(bundle_results(), "internet_port") && bundle_results().internet_ppp.final_analysis != "failed";
var hasSync = _.has(bundle_results(), "internet_port") && bundle_results().internet_port.sync_status === "Up";
var iconSuffix = !isRelevant ? "down" : !hasTestResults ? "test-fail" : hasSync ? "up" : "down";
%>
</div>

Upvotes: 2

Views: 956

Answers (2)

BaSsGaz
BaSsGaz

Reputation: 784

You can now use EJS language support (or similar) extension to provide syntax highlighting and autocompletion for EJS (Embedded JavaScript) templates.

Upvotes: 0

Benjamin Gruenbaum
Benjamin Gruenbaum

Reputation: 276326

Those templates are called ejs, they are not supported in Visual Studio.

Here is a request for them in the Microsoft uservoice.

So the answer to your question is "you can't".

Upvotes: 3

Related Questions