Skip to content

Commit 929e50f

Browse files
committed
Add ArkTS language support with .ets extension and HarmonyOS samples
1 parent d94f797 commit 929e50f

6 files changed

Lines changed: 86 additions & 6 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish Docker image
2+
on:
3+
release:
4+
types: [published]
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
packages: write
16+
contents: read
17+
attestations: write
18+
id-token: write
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Extract metadata (tags, labels) for Docker
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
with:
31+
images: ghcr.io/${{ github.repository }}
32+
33+
- name: Log in to GitHub Container Registry
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Build and push
41+
id: push
42+
uses: docker/build-push-action@v6
43+
with:
44+
push: true
45+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
46+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+
50+
- name: Generate artifact attestation
51+
uses: actions/attest-build-provenance@v2
52+
with:
53+
subject-name: ghcr.io/${{ github.repository }}
54+
subject-digest: ${{ steps.push.outputs.digest }}
55+
push-to-registry: true

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
[submodule "vendor/grammars/Alloy.tmbundle"]
88
path = vendor/grammars/Alloy.tmbundle
99
url = https://github.com/macekond/Alloy.tmbundle
10+
[submodule "vendor/grammars/ArkTS"]
11+
path = vendor/grammars/ArkTS
12+
url = https://github.com/ohosvscode/arkTS
1013
[submodule "vendor/grammars/Assembly-Syntax-Definition"]
1114
path = vendor/grammars/Assembly-Syntax-Definition
1215
url = https://github.com/calculuswhiz/Assembly-Syntax-Definition
@@ -1530,6 +1533,3 @@
15301533
[submodule "vendor/grammars/zephir-sublime"]
15311534
path = vendor/grammars/zephir-sublime
15321535
url = https://github.com/phalcon/zephir-sublime
1533-
[submodule "vendor/grammars/ArkTS"]
1534-
path = vendor/grammars/ArkTS
1535-
url = https://github.com/ohosvscode/arkTS

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,20 @@ grammars.yml: 884 lines (884 sloc)
184184

185185
#### Docker
186186

187-
If you have Docker installed you can build an image and run Linguist within a container:
187+
If you have Docker installed you can either build or use
188+
our pre-built images and run Linguist within a container:
189+
190+
```console
191+
$ docker run --rm -v $(pwd):$(pwd):Z -w $(pwd) -t ghcr.io/github-linguist/linguist:latest
192+
66.84% 264519 Ruby
193+
24.68% 97685 C
194+
6.57% 25999 Go
195+
1.29% 5098 Lex
196+
0.32% 1257 Shell
197+
0.31% 1212 Dockerfile
198+
```
199+
200+
##### Building the image
188201

189202
```console
190203
$ docker build -t linguist .

grammars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ vendor/grammars/AL:
44
- source.al
55
vendor/grammars/Alloy.tmbundle:
66
- source.alloy
7+
vendor/grammars/ArkTS:
8+
- source.ets
79
vendor/grammars/Assembly-Syntax-Definition:
810
- source.x86
911
vendor/grammars/Atom-PostScript:
@@ -163,8 +165,6 @@ vendor/grammars/SublimeXtend:
163165
vendor/grammars/Syntax-highlighting-for-PostCSS:
164166
- source.css.postcss.sugarss
165167
- source.postcss
166-
vendor/grammars/ArkTS:
167-
- source.ets
168168
vendor/grammars/SystemVerilog:
169169
- source.systemverilog
170170
- source.ucfconstraints

lib/linguist/languages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4023,6 +4023,8 @@ Lean:
40234023
Lean 4:
40244024
type: programming
40254025
group: Lean
4026+
aliases:
4027+
- lean4
40264028
extensions:
40274029
- ".lean"
40284030
tm_scope: source.lean4
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: ArkTS
3+
version: 107a21c78819540405549c9e65d9447d313c165a
4+
type: git_submodule
5+
homepage: https://github.com/ohosvscode/arkTS
6+
license: mit
7+
licenses:
8+
- sources: LICENSE
9+
text: "MIT License\n\nCopyright (c) 2025 Naily Zero\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
10+
notices: []

0 commit comments

Comments
 (0)