Closed javoire closed 10 years ago
@javoire I ended up implementing your Solution 2 as it seemed like the cleanest approach and other people had been asking for the same support. Sorry this took so long!
Awesome! no probs!
By the way. Does this cover the case when a html.eco file contains both html-comments
<!--
AND eco comments
//
at the same time? Or will it only treat it as a html-file? :)
Currently, it will use the last filetype as the comment type
i.e. myfile.html.eco
will be recognized as .eco
and use the //
comment type associated with .eco
files. If you had myfile.html.eco.js
then the recognized extension would be .js
and the associated comment types would be used.
There isn't any support for looking for all listed filetype comments but that might be something to add (pretty straight forward too). I want to think a little about where that might cause problems or be unwanted behavior before adding it in though, if you can think of any possible issues let me know.
Cool. Actually in my use case I'm looking for the exact opposite; the first filetype as comment type. E.g. .html.eco
as .html
and .js.eco
as .js
:)
Usually in an .html.eco file, the majority of the code is html, and likewise for the .js.eco.
However, in a js.coffee file that would be the exact opposite. (all of it is coffee)
So therefore I'd say the best solution would to actually look for all comment types in a file with multiple file endings. Yes, I'll let you know if think of anything.
.html.eco contains <!-- comments but the parser disregards the .html.eco since it's not in the extensions array
.html.eco and .js.eco are two common eco extensions
Solution 1
would be a solution but the parser currently identifies the double extension as a single one:
and
instead of just
Solution 2
The parser traverses the extensions until it reaches the first one
Thus recognizing the extension as a normal .html or .js
I can take a look at it but which version would be preferred?
Cheers Jonatan