Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio does not recognize ES6 template strings

I have issues getting both Visual Studio Code and Visual Studio 2013 to recognize the special syntax of template strings (ES6):

Visual Studio Code

enter image description here

Visual Studio 2013

enter image description here

What am I missing?

like image 379
transporter_room_3 Avatar asked Dec 10 '15 18:12

transporter_room_3


2 Answers

This should be working now, there is no issue for basic examples in VSCode 1.14.0

enter image description here

I suspect they were just a bit late to the backtick party. There are however still many unclosed issues relating to things like better support for template grammars and language support in ES6 template strings so it appears there is much work to do for advanced capabilities being included.

like image 133
Anthropic Avatar answered Sep 19 '22 19:09

Anthropic


Try to use back ticks (`), not single or double quotes

var name = 'Walton';
console.log(`Hi ${name}`);
like image 20
akash maurya Avatar answered Sep 20 '22 19:09

akash maurya