ejs-grammar
ejs-grammar copied to clipboard
Vscode isn't recognizing EJS in the languages modes
I tried to install your extension manually from github and compile it but that fails
Steps to reproduce:
- I clone your repository
- I open it in vscode and I ran npm install
- I moved the folder to the extension folder in the users folder
Expected result:
It must work as this is the known way of compiling extensions. Note: Your extension appears in the list but it doesn't work.
The extension does not get compiled. Move the entire folder to your extension folder. Then reload the window.
This what I did but it didn't work.
You mentioned it appears in the list, Which list are you talking about?
The extension as it is currently, operates in the background. If you have a file named ".ejs", it will be working in that file. Technically it works with all files that have "html" as the default language.
Something you could try doing is, installing an older version (make sure auto updates is turned off) then replace the contents with the cloned files. If you do not want to turn auto updates off, install the latest but in the cloned version, change the package version to something higher, this will prevent it from being overwritten, then move the contents to the extension location.
@Betanu701 I understood something. Even if I installed your extension via VSIX. It doesn't work. Vscode doesn't recognize ejs in the languages modes as before.
Version 1.0+ does not show in the languages. Set the language to HTML. It will work.
I am facing the same issue.
In my case, it turned out not to be an issue with this extension, but rather my HTMLHint configuration, which was causing all of the <%
's. and %>
's to get underlined rather than highlighted, and listed lots of warnings.
after I added the following to my settings.json
"htmlhint.options": {
"spec-char-escape": false,
"doctype-first": false,
},
it's working great now.
Whenever I go to my settings.json I added that in. But for some reason I am getting a red squiggle line at the top. It looks like this before it put in your code
I could be misunderstanding, but it looks like you merely append that snippet to the file. if so, that isn't the correct syntax, and it should look like:
{
/* perhaps some stuff */
"files.associations": {
"*.ejs": "html"
},
"htmlhint.options": {
"spec-char-escape": false,
"doctype-first": false
},
/* perhaps other stuff */
}
Hmm I pasted in your code but now it has a squiggle line on the "htmlhint.options"
Because you don’t have HTMLHint installed, so VS Code isn’t recognising the option.
Okay so I got my user settings all set up correctly. But the ejs still will not compile. It looks like this
I'm guessing in the bottom left corner of the window it will have linter errors/warnings. In my case ,there where htmlhint warnings, I'm guessing yours are something else. if it lists error codes, google search them, and you'll be able to determine what extension is causing them, and then how to make changes in settings.json so that it doesn't report/display EJS tags as errors.
Yeah I have no errors either. I'm debating whether I should just start from scratch again
@minkir014 Did you ever end up figuring out what your issue was?
It was working very well until the last update syntax work but the same thing is not for closing tags and others.
@minkir014 Did it ever look like this?
Closing tags and multiple lines should be working in version 1.2