Digitalbrainstem / ejs-grammar

EJS Grammar for VSCode
MIT License
76 stars 28 forks source link

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

Open rmgreenstreet opened 4 years ago

rmgreenstreet commented 4 years ago

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.

abedmurrar commented 4 years ago

digitalbrainstem.javascript-ejs-support v1.3.1

Same here

image

image

SamukaDEV commented 4 years ago

me too

image

any update about this? 🥺

Betanu701 commented 4 years ago

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