Skip to content

Commit d5fbce2

Browse files
authored
Merge pull request desktop#19032 from imkylecat/development
Better Lua and Luau Support
2 parents d6c10a2 + f6d620c commit d5fbce2

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

app/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"byline": "^5.0.0",
2424
"chalk": "^2.3.0",
2525
"classnames": "^2.2.5",
26-
"codemirror": "^5.60.0",
26+
"codemirror": "^5.65.17",
2727
"codemirror-mode-elixir": "^1.1.2",
28-
"codemirror-mode-zig": "^1.0.3",
28+
"codemirror-mode-luau": "^1.0.2",
29+
"codemirror-mode-zig": "^1.0.7",
2930
"compare-versions": "^3.6.0",
3031
"deep-equal": "^1.0.1",
3132
"desktop-notifications": "^0.2.4",

app/src/highlighter/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ const extensionModes: ReadonlyArray<IModeDefinition> = [
277277
},
278278
},
279279
{
280-
install: () => import('codemirror/mode/lua/lua'),
280+
install: () => import('codemirror-mode-luau'),
281281
mappings: {
282282
'.lua': 'text/x-lua',
283+
'.luau': 'text/x-luau',
283284
},
284285
},
285286
{
@@ -464,6 +465,12 @@ const basenameModes: ReadonlyArray<IModeDefinition> = [
464465
dockerfile: 'text/x-dockerfile',
465466
},
466467
},
468+
{
469+
install: () => import('codemirror/mode/toml/toml'),
470+
mappings: {
471+
'cargo.lock': 'text/x-toml',
472+
},
473+
},
467474
]
468475

469476
/**

app/yarn.lock

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,20 @@ codemirror-mode-elixir@^1.1.2:
186186
resolved "https://registry.yarnpkg.com/codemirror-mode-elixir/-/codemirror-mode-elixir-1.1.2.tgz#61227208d2684d928500af6934e4b9c995fb0960"
187187
integrity sha512-1oIuRVHyUhLv0Za9sEIsI7urAj06EohwO/yVj10bg7aHnimHQ964Wk3uuoPH0Yn8L38EkOd+SwULYpDiCQtoTA==
188188

189-
codemirror-mode-zig@^1.0.3:
190-
version "1.0.3"
191-
resolved "https://registry.yarnpkg.com/codemirror-mode-zig/-/codemirror-mode-zig-1.0.3.tgz#bbe0ca19d90b740299b0920256836cc5dce82ba6"
192-
integrity sha512-XoA5P5PsuxgAgBUYdTo4+NIrgnsWWAx8WbH16aflaUOVvfN3PMWSMGytlrsVSaOqpip2YQG9kedmWs3bGIXp7A==
193-
194-
codemirror@^5.60.0:
195-
version "5.60.0"
196-
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.60.0.tgz#00a8cfd287d5d8737ceb73987f04aee2fe5860da"
197-
integrity sha512-AEL7LhFOlxPlCL8IdTcJDblJm8yrAGib7I+DErJPdZd4l6imx8IMgKK3RblVgBQqz3TZJR4oknQ03bz+uNjBYA==
189+
codemirror-mode-luau@^1.0.2:
190+
version "1.0.2"
191+
resolved "https://registry.yarnpkg.com/codemirror-mode-luau/-/codemirror-mode-luau-1.0.2.tgz#282689d3f3c10f1bc262c885ce79ff90731d3a72"
192+
integrity sha512-WvEIX0mtdp/sHbQqHJLyZJhu9Z6EhKEzcpK+iDrEOAY/tCAA1ThoPYcQ9eFf4qSx/P3qvDnW518mZyBSmtJjWg==
193+
194+
codemirror-mode-zig@^1.0.7:
195+
version "1.0.7"
196+
resolved "https://registry.yarnpkg.com/codemirror-mode-zig/-/codemirror-mode-zig-1.0.7.tgz#589416e4de4bd28636a34cbeed276e6fb2d4b380"
197+
integrity sha512-4kvvZ0T7z2zobBoQq/vfcn6TZZFdZr5OhPDHDUqfkT3iK6tW18SkfM7MYbWts7XmAvXPl6wC81i0ppDOCoOXyw==
198+
199+
codemirror@^5.65.17:
200+
version "5.65.17"
201+
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.17.tgz#00d71f34c3518471ae4c0de23a2f8bb39a6df6ca"
202+
integrity sha512-1zOsUx3lzAOu/gnMAZkQ9kpIHcPYOc9y1Fbm2UVk5UBPkdq380nhkelG0qUwm1f7wPvTbndu9ZYlug35EwAZRQ==
198203

199204
color-convert@^1.9.0:
200205
version "1.9.0"

docs/technical/syntax-highlighting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We introduced syntax highlighted diffs in [#3101](https://github.com/desktop/des
88

99
We currently support syntax highlighting for the following languages and file types.
1010

11-
JavaScript, JSON, TypeScript, Coffeescript, HTML, Asp, JavaServer Pages, CSS, SCSS, LESS, VUE, Markdown, Yaml, XML, Diff, Objective-C, Scala, C#, Java, C, C++, Kotlin, Ocaml, F#, Swift, sh/bash, SQL, CYPHER, Go, Perl, PHP, Python, Ruby, Clojure, Rust, Elixir, Haxe, R, PowerShell, Visual Basic, Fortran, Lua, Crystal, Julia, sTex, SPARQL, Stylus, Soy, Smalltalk, Slim, HAML, Sieve, Scheme, ReStructuredText, RPM, Q, Puppet, Pug, Protobuf, Properties, Apache Pig, ASCII Armor (PGP), Oz, Pascal, Toml, Dart, CMake, Zig and Docker.
11+
JavaScript, JSON, TypeScript, Coffeescript, HTML, Asp, JavaServer Pages, CSS, SCSS, LESS, VUE, Markdown, Yaml, XML, Diff, Objective-C, Scala, C#, Java, C, C++, Kotlin, Ocaml, F#, Swift, sh/bash, SQL, CYPHER, Go, Perl, PHP, Python, Ruby, Clojure, Rust, Elixir, Haxe, R, PowerShell, Visual Basic, Fortran, Lua, Luau, Crystal, Julia, sTex, SPARQL, Stylus, Soy, Smalltalk, Slim, HAML, Sieve, Scheme, ReStructuredText, RPM, Q, Puppet, Pug, Protobuf, Properties, Apache Pig, ASCII Armor (PGP), Oz, Pascal, Toml, Dart, CMake, Zig and Docker.
1212

1313
This list was never meant to be exhaustive, we expect to add more languages going forward but this seemed like a good first step.
1414

0 commit comments

Comments
 (0)