You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
AFAICT, no frontend code is involved in determining the language as passed to the syntax highlighter.
Recommended fix: For the .m file extension, go through go-enry to detect the language.
Potential tweak: Always determine the language through go-enry and use that to set the filetype for syntax highlighting, regardless of the file extension.
Caution: We should probably cut the file to an arbitrary fixed size to bound the amount of time spent by go-enry doing language detection, in case the file in question is very large.
This issue is scoped to syntax highlighting and Matlab only. Subpart of https://github.com/sourcegraph/sourcegraph/issues/55554
For reference:
filetypein the syntax highlighter: https://sourcegraph.com/github.com/sourcegraph/sourcegraph@64014d3/-/blob/docker-images/syntax-highlighter/crates/sg-syntax/src/lib.rs?L142:32-142:40#tab=defAFAICT, no frontend code is involved in determining the language as passed to the syntax highlighter.
Recommended fix: For the
.mfile extension, go throughgo-enryto detect the language.go-enryand use that to set thefiletypefor syntax highlighting, regardless of the file extension.go-enrydoing language detection, in case the file in question is very large.Related: https://github.com/sourcegraph/sourcegraph/issues/56379