Skip to content

Commit eb661cc

Browse files
swsniderpokey
andauthored
Add swift language support (already a tree-sitter language). (#70)
* Add swift language support (already a tree-sitter language). Had to set resolution overrides for `node-gyp` and `nan` to get everything building locally with node v19.8.1 and yarn 1.22.19 * Pin swift version * Remove resolutions, as it's out of scope here * Fix yarn.lock --------- Co-authored-by: Pokey Rule <[email protected]>
1 parent c7b2ca8 commit eb661cc

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For generating .wasm files for parsers
22
# See https://www.npmjs.com/package/web-tree-sitter
3-
LANGUAGES = agda bash c c-sharp clojure cpp css elm elixir go haskell html java javascript json julia kotlin latex lua markdown nix perl php python query ruby rust scala scss sparql talon tsx typescript yaml
3+
LANGUAGES = agda bash c c-sharp clojure cpp css elm elixir go haskell html java javascript json julia kotlin latex lua markdown nix perl php python query ruby rust scala scss sparql swift talon tsx typescript yaml
44

55
# Build web-tree-sitter parsers for $(LANGUAGES)
66

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"onLanguage:shellscript",
5656
"onLanguage:sparql",
5757
"onLanguage:starlark",
58+
"onLanguage:swift",
5859
"onLanguage:talon",
5960
"onLanguage:typescript",
6061
"onLanguage:typescriptreact",
@@ -121,6 +122,7 @@
121122
"tree-sitter-scala": "github:tree-sitter/tree-sitter-scala#master",
122123
"tree-sitter-scss": "github:serenadeai/tree-sitter-scss#c478c6868648eff49eb04a4df90d703dc45b312a",
123124
"tree-sitter-sparql": "^0.1.0",
125+
"tree-sitter-swift": "github:alex-pinkus/tree-sitter-swift#7e4ccc97a25315022a70b730085deccd5680a39b",
124126
"tree-sitter-talon": "github:wenkokke/tree-sitter-talon#fd202684c693d1b893fe34575209452424cc9909",
125127
"tree-sitter-typescript": "github:tree-sitter/tree-sitter-typescript#286e90c32060032225f636a573d0e999f7766c97",
126128
"tree-sitter-yaml": "^0.5.0",

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const languages: {
4545
shellscript: { module: "tree-sitter-bash" },
4646
sparql: { module: "tree-sitter-sparql" },
4747
starlark: { module: "tree-sitter-python" },
48+
swift: { module: "tree-sitter-swift" },
4849
talon: { module: "tree-sitter-talon" },
4950
typescript: { module: "tree-sitter-typescript" },
5051
typescriptreact: { module: "tree-sitter-tsx" },

yarn.lock

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@ tree-sitter-c@^0.19.0:
24192419
dependencies:
24202420
nan "^2.14.0"
24212421

2422-
tree-sitter-cli@^0.20.1:
2422+
tree-sitter-cli@=0.20.6, tree-sitter-cli@^0.20.1:
24232423
version "0.20.6"
24242424
resolved "https://registry.yarnpkg.com/tree-sitter-cli/-/tree-sitter-cli-0.20.6.tgz#2a7202190d7bd64e112b451f94573dbe40a04f04"
24252425
integrity sha512-tjbAeuGSMhco/EnsThjWkQbDIYMDmdkWsTPsa/NJAW7bjaki9P7oM9TkLxfdlnm4LXd1wR5wVSM2/RTLtZbm6A==
@@ -2583,6 +2583,14 @@ tree-sitter-sparql@^0.1.0:
25832583
dependencies:
25842584
nan "^2.14.1"
25852585

2586+
"tree-sitter-swift@github:alex-pinkus/tree-sitter-swift#7e4ccc97a25315022a70b730085deccd5680a39b":
2587+
version "0.3.6"
2588+
resolved "https://codeload.github.com/alex-pinkus/tree-sitter-swift/tar.gz/7e4ccc97a25315022a70b730085deccd5680a39b"
2589+
dependencies:
2590+
nan "^2.15.0"
2591+
tree-sitter-cli "=0.20.6"
2592+
which "2.0.2"
2593+
25862594
"tree-sitter-talon@github:wenkokke/tree-sitter-talon#fd202684c693d1b893fe34575209452424cc9909":
25872595
version "3.5.0"
25882596
resolved "https://codeload.github.com/wenkokke/tree-sitter-talon/tar.gz/fd202684c693d1b893fe34575209452424cc9909"
@@ -2749,7 +2757,7 @@ which-pm-runs@^1.0.0:
27492757
resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.1.0.tgz#35ccf7b1a0fce87bd8b92a478c9d045785d3bf35"
27502758
integrity sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==
27512759

2752-
which@^2.0.1, which@^2.0.2:
2760+
which@2.0.2, which@^2.0.1, which@^2.0.2:
27532761
version "2.0.2"
27542762
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
27552763
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==

0 commit comments

Comments
 (0)