linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Include support for JSP tag files

Open rn4n opened this issue 8 years ago • 7 comments

Hi,

I would like to suggest support for files with the extension ".tag". They have the same syntax used by JSP language, but it is not displayed with the same syntax highlighting:

:pray:

rn4n avatar Jun 30 '16 03:06 rn4n

If we add the .tag file extension to JSP, we also need to add it to every other language that use it (otherwise all .tag files will be indentified as JSP). Thus, we first need to identify languages that use the .jsp file extension. @reebr Are those files JSP tag files?

So far, I found:

pchaigno avatar Jun 30 '16 10:06 pchaigno

Woah, there're several languages that use this file format, I didn't know that. Thanks for the search @pchaigno.

I'm not sure about these files, but it seems they use the Play framework template tags. But those files, they are definitely not related to Java / JSP.

Maybe it's a bad idea implement this for a specific language, there are a lot of ".tag" types.

rn4n avatar Jul 01 '16 01:07 rn4n

I'm not sure about these files, but it seems they use the Play framework template tags.

So... they are JSP files too?

Maybe it's a bad idea implement this for a specific language, there are a lot of ".tag" types. :disappointed:

I think we're fine so far. It's more of an issue when there are many different data files (because we don't have a good way to detect them).

pchaigno avatar Jul 01 '16 17:07 pchaigno

So... they are JSP files too?

I don't think so. To be honest, I didn't even know about this framework until you answered me, I researched about it after that. I believe it's more related to Java and Scala, although JSP is a Java technology those files look different.

It would be nice to have them recognized and syntax highlighted, but apparently It's hard to define where the file will be used, can be a java application, scala or even C ++ (as in the repositories you showed).

rn4n avatar Jul 02 '16 02:07 rn4n

I counted 366 repositories by 315 different users from this small search for Play framework template files. It should be enough to add this language/framework too. We'll have to make sure on the exact name though. I'll ask around.

pchaigno avatar Jul 04 '16 20:07 pchaigno

Any reason for the 4 years of nothing in this issue?

Anyway, searching 'extension:tag' gives a few other languages, such as CSV, XML, whatever this is, txt. Is it fine to add .tag as "JSP tag" even though there will be these false positives? What is usual practice when theres a bunch of weird files attached to slightly-generic filenames?

Nixinova avatar Feb 06 '21 05:02 Nixinova

@Nixinova since this is was opened we've implemented the ability to add generic extensions to the https://github.com/github/linguist/blob/master/lib/linguist/generic.yml file with a corresponding heuristic for each language.

lildude avatar Aug 05 '21 07:08 lildude