github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.15k stars 4.21k forks source link

Add language: Blazor #6883

Closed andreadottor closed 2 months ago

andreadottor commented 3 months ago

Language name

Blazor

URL of example repository

https://github.com/andreadottor/Umarell-BlazorWebApp https://github.com/dotnet/blazor-samples

URL of syntax highlighting grammar

Most popular extensions

.razor

Detected language

JavaScript or HTML

heIgee commented 2 months ago

I think it should be called Razor, for Blazor is a framework

lildude commented 2 months ago

In that case, Linguist already supports it:

https://github.com/github-linguist/linguist/blob/39fd5e93de98de3434cb3e857c5b1972c418f8c5/lib/linguist/languages.yml#L2821-L2834 so nothing more to do as we don't add support for frameworks.

andreadottor commented 2 months ago

@heIgee yep, and in this case we can include also the files with .cshtml extension, that use Razor Engine.

heIgee commented 2 months ago

In that case, Linguist already supports it:

https://github.com/github-linguist/linguist/blob/39fd5e93de98de3434cb3e857c5b1972c418f8c5/lib/linguist/languages.yml#L2821-L2834 so nothing more to do as we don't add support for frameworks.

The problem is that linguist considers it HTML. I don't find it fair, since Razor files can contain more C# than actual markup. Similar EJS, for example, is treated as a separate language