Skip to content

Commit

Permalink
syntaxes: add fileTypes for TextMate highlighters such as Syntect and…
Browse files Browse the repository at this point in the history
… Sourcegraph (#12)

Will enable syntax highlighting of CUE files on Sourcegraph.com.

Note that this is just following the TextMate grammar / JSON schema format,
nothing here is unique to Sourcegraph.

If there are other common extensions than just `.cue` that should be considered
Cue language files, we should include them here as well.

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
  • Loading branch information
slimsag committed Aug 3, 2021
1 parent 4dff3d1 commit 0734615
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/cmd/gen-syntax/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import (
)

var root = struct {
Schema string `json:"$schema"`
Name string `json:"name"`
ScopeName string `json:"scopeName"`
Patterns Rules `json:"patterns"`
Repository RuleMap `json:"repository"`
Schema string `json:"$schema"`
Name string `json:"name"`
FileTypes []string `json:"fileTypes"`
ScopeName string `json:"scopeName"`
Patterns Rules `json:"patterns"`
Repository RuleMap `json:"repository"`
}{
Schema: "https://github.com/raw/martinring/tmlanguage/master/tmlanguage.json",
Name: "CUE",
FileTypes: []string{"cue"},
ScopeName: "source.cue",
Patterns: patterns,
Repository: repository,
Expand Down
3 changes: 3 additions & 0 deletions syntaxes/cue.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://github.com/raw/martinring/tmlanguage/master/tmlanguage.json",
"name": "CUE",
"fileTypes": [
"cue"
],
"scopeName": "source.cue",
"patterns": [
{
Expand Down

0 comments on commit 0734615

Please sign in to comment.