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

Vscode isn't recognizing EJS in the languages modes

Open minkir014 opened this issue 5 years ago • 18 comments

I tried to install your extension manually from github and compile it but that fails

Steps to reproduce:

  1. I clone your repository
  2. I open it in vscode and I ran npm install
  3. 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.

minkir014 avatar Sep 12 '19 11:09 minkir014

The extension does not get compiled. Move the entire folder to your extension folder. Then reload the window.

Betanu701 avatar Sep 12 '19 13:09 Betanu701

This what I did but it didn't work.

minkir014 avatar Sep 12 '19 14:09 minkir014

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 avatar Sep 12 '19 20:09 Betanu701

@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.

too

minkir014 avatar Oct 10 '19 06:10 minkir014

Version 1.0+ does not show in the languages. Set the language to HTML. It will work.

Betanu701 avatar Oct 10 '19 10:10 Betanu701

I am facing the same issue.

minkir014 avatar Oct 13 '19 21:10 minkir014

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.

ckot avatar Oct 13 '19 21:10 ckot

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 Screen Shot 2019-10-17 at 3 51 49 PM

fkhan698 avatar Oct 17 '19 20:10 fkhan698

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 */
}

ckot avatar Oct 17 '19 21:10 ckot

Hmm I pasted in your code but now it has a squiggle line on the "htmlhint.options" Screen Shot 2019-10-17 at 5 03 16 PM

fkhan698 avatar Oct 17 '19 22:10 fkhan698

Because you don’t have HTMLHint installed, so VS Code isn’t recognising the option.

ExE-Boss avatar Oct 17 '19 23:10 ExE-Boss

Okay so I got my user settings all set up correctly. But the ejs still will not compile. It looks like this Screen Shot 2019-10-18 at 12 23 53 PM

fkhan698 avatar Oct 18 '19 17:10 fkhan698

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.

ckot avatar Oct 18 '19 18:10 ckot

Yeah I have no errors either. I'm debating whether I should just start from scratch again

fkhan698 avatar Oct 18 '19 19:10 fkhan698

@minkir014 Did you ever end up figuring out what your issue was?

fkhan698 avatar Oct 22 '19 17:10 fkhan698

It was working very well until the last update syntax work but the same thing is not for closing tags and others.

minkir014 avatar Oct 22 '19 18:10 minkir014

@minkir014 Did it ever look like this? Screen Shot 2019-10-18 at 12 23 53 PM

fkhan698 avatar Oct 23 '19 23:10 fkhan698

Closing tags and multiple lines should be working in version 1.2

Betanu701 avatar Jan 14 '20 18:01 Betanu701