ejs-grammar icon indicating copy to clipboard operation
ejs-grammar copied to clipboard

Syntax highlighting breaks when casting EJS variable to front-end variable in a <script> tag

Open rmgreenstreet opened this issue 5 years ago • 3 comments

Steps to reproduce:

Working in an EJS file, I want to send the EJS variable into front-end code, however the editor/'problems' section sees this as incorrect syntax:

image

image

To reproduce:

<script>
    var myVar = <%- JSON.stringify(ejsVar) %>
</script>

Expected result:

Embedding/declaring a front-end variable using EJS variables should be included in syntax highlighting.

rmgreenstreet avatar Jun 01 '20 21:06 rmgreenstreet

digitalbrainstem.javascript-ejs-support v1.3.1

Same here

image

image

abedmurrar avatar Jul 17 '20 15:07 abedmurrar

me too

image

any update about this? 🥺

SamukaDEV avatar Aug 18 '20 14:08 SamukaDEV

Hey all,

I know this is an on going bug. I have not looked into the resent versions of Viscose to see if I can handle this. The problem is not really with the extension but with the language server underneath.

I have tried to fix this, with just using the extension code and it fails still. I think the issue is because the script/style tags are changing the way the linter is reading the code.

We may need to write a patch for the default linters to allow seeing ejs inside of script/style tags

Betanu701 avatar Nov 10 '20 04:11 Betanu701