Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Consistently highlight Matlab files using the Matlab language grammar #56372

@varungandhi-src

Description

@varungandhi-src

This issue is scoped to syntax highlighting and Matlab only. Subpart of https://github.com/sourcegraph/sourcegraph/issues/55554

For reference:

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.

Related: https://github.com/sourcegraph/sourcegraph/issues/56379

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions