-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ShaderLab language #3490
Add ShaderLab language #3490
Conversation
|
I believe these keywords are present in ShaderLab but unlikely to appear in other shader languages: However, some of them are GLSL. |
Ah, thanks for noticing that. Presumably I should add the On a possibly related note, I think there's a bug in this classifier test: Samples.each do |sample|
language = Linguist::Language.find_by_name(sample[:language])
languages = Language.find_by_filename(sample[:path]).map(&:name)
next unless languages.length > 1
results = Classifier.classify(Samples.cache, File.read(sample[:path]), languages)
assert_equal language.name, results.first[0], "#{sample[:path]}\n#{results.inspect}"
end It never gets beyond the |
Nice catch! That is the correct fix :-) |
If the samples doesn't do the trick, lib/linguist/heuristics.rb is your friend. |
I've opened #3494 with a fix for the ambiguous classification test.
It looks like the samples are enough - assuming I fixed the test correctly in #3494, and that I'm testing the right thing :) |
Please let me know if you need anything more from me on this PR. |
Travis says the pull request doesn't pass build/test. |
Note that these are copies of existing GLSL samples, renamed to have the .shader extension.
Oops, somehow didn't notice that (or rather I did, but I looked at the build failure for a different Ruby version that had unrelated errors, and thought it wasn't caused by my changes). Anyway, fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Added: * .pyi to Python extensions: github-linguist/linguist#3548 * .shader to 3D object extensions: github-linguist/linguist#3490 * .mdwn to Markdown extensions: github-linguist/linguist#3534 * Jest icon to .js.snap files: github-linguist/linguist#3579
This PR adds a new language definition for ShaderLab (used to write shaders in the Unity game engine). It uses the grammar that was already added as part of #3469.
I've moved the
.shader
extension from the GLSL language definition (where it was incorrect, but better than nothing) to the new ShaderLab language definition.ShaderLab search result on GitHub.com