Skip to content

Commit

Permalink
use pkl.tmBundle grammar (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
stackoverflow authored Mar 12, 2024
1 parent 4cb1448 commit 2e35d23
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 645 deletions.
1 change: 1 addition & 0 deletions .circleci/config.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs {
echo 'export PATH=/tmp/pkl:${PATH}' >> $BASH_ENV
"""#
}
new RunStep { command = "git submodule update --init --recursive" }
new RunStep { command = "npm ci" }
new RunStep { command = "npm run build" }
new RunStep { command = "npm test" }
Expand Down
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
chmod +x /tmp/pkl/pkl
echo 'export PATH=/tmp/pkl:${PATH}' >> $BASH_ENV
name: Download Pkl
- run:
command: git submodule update --init --recursive
- run:
command: npm ci
- run:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "textmate-bundle"]
path = textmate-bundle
url = https://github.com/apple/pkl.tmbundle.git
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@
"lint:fix": "prettier -w src/",
"lint": "prettier -c src/",
"watch": "npm run esbuild-base -- --sourcemap --watch",
"test": "node scripts/license-header.js test",
"test": "node scripts/license-header.js test && npm run test:grammar",
"test:grammar": "sh scripts/check-grammar",
"prepackage": "npm run build",
"package": "mkdir -p .dist/vscode && vsce package --out .dist/vscode/pkl-vscode-$npm_package_version.vsix",
"package-only": "mkdir -p .dist/vscode && vsce package --out .dist/vscode/pkl-vscode-$npm_package_version.vsix",
"preinstallextension": "npm run package",
"installextension": "code --install-extension .dist/vscode/pkl-vscode-$npm_package_version.vsix",
"add-license-headers": "node scripts/license-header.js"
"add-license-headers": "node scripts/license-header.js",
"clone-grammar": "git submodule update --init --recursive"
},
"devDependencies": {
"@apple/tree-sitter-pkl": "^0.16.0",
Expand Down
8 changes: 8 additions & 0 deletions scripts/check-grammar
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ -e "textmate-bundle/Syntaxes/pkl.tmLanguage" ]; then
exit 0
else
echo "Could not find grammar file."
exit 1
fi
2 changes: 1 addition & 1 deletion src/pkl/index.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
output {
files {
["out/pkl.tmLanguage.json"] = import("pkl.tmLanguage.pkl").output
["out/pkl.snippets.json"] = import("snippets.pkl").output
["out/pkl.snippets.json"] = import("../../textmate-bundle/pkl/snippets.pkl").output
}
}
Loading

0 comments on commit 2e35d23

Please sign in to comment.