Skip to content

Commit

Permalink
Rewrite syntax for ST4
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Dec 4, 2024
1 parent 9e60ec5 commit 565b247
Show file tree
Hide file tree
Showing 40 changed files with 8,202 additions and 600 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Git
.github/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore

# Development
tests/ export-ignore
70 changes: 70 additions & 0 deletions .github/workflows/ci-syntax-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI Syntax Tests

on:
push:
branches:
- master
- st4107
tags-ignore:
- '**'
paths:
- '.github/workflows/ci-syntax-tests.yml'
- '**.sublime-syntax'
- '**/syntax_test_*'
pull_request:
paths:
- '.github/workflows/ci-syntax-tests.yml'
- '**.sublime-syntax'
- '**/syntax_test_*'
workflow_dispatch:

jobs:
syntax_tests:
name: Sublime Text ${{ matrix.build }}
runs-on: ubuntu-latest
timeout-minutes: 15 # default is 6 hours!
strategy:
matrix:
include:
# Stable ST4 builds
- build: 4107
default_packages: v4107
- build: 4126
default_packages: v4126
- build: 4143
default_packages: v4143
- build: 4152
default_packages: v4152
- build: 4169
default_packages: v4169
- build: 4180
default_packages: v4180
# Latest dev build
- build: latest
default_packages: master
steps:
- name: Checkout Default Packages
uses: actions/checkout@v4
with:
repository: sublimehq/Packages
ref: ${{ matrix.default_packages }}
path: st_syntax_tests/Data/Packages

- name: Delete default package tests
run: find st_syntax_tests/Data/Packages/*/ -type f -name 'syntax_test*' -exec rm -v '{}' \;

- name: Checkout XSL
uses: actions/checkout@v4
with:
path: st_syntax_tests/Data/Packages/XSL

- name: Run Syntax Tests for Sublime Text ${{ matrix.build }}
run: |
if [[ "${{ matrix.build }}" == "latest" ]]; then
wget -O st_syntax_tests.tar.xz https://download.sublimetext.com/latest/dev/linux/x64/syntax_tests
else
wget -O st_syntax_tests.tar.xz https://download.sublimetext.com/st_syntax_tests_build_${{ matrix.build }}_x64.tar.xz
fi
tar xf st_syntax_tests.tar.xz
cd st_syntax_tests
./syntax_tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8
84 changes: 84 additions & 0 deletions Completions/XPath Axes Names.sublime-completions
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
// if current token is an illegal axis, double colon already exists
"scope": "source.xpath invalid.illegal.axis",
"completions": [
{
"trigger": "ancestor::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "ancestor"
},
{
"trigger": "ancestor-or-self::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "ancestor-or-self"
},
{
"trigger": "attribute::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "attribute"
},
{
"trigger": "child::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "child"
},
{
"trigger": "descendant::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "descendant"
},
{
"trigger": "descendant-or-self::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "descendant-or-self"
},
{
"trigger": "following::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "following"
},
{
"trigger": "following-sibling::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "following-sibling"
},
{
"trigger": "namespace::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "namespace"
},
{
"trigger": "parent::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "parent"
},
{
"trigger": "preceding::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "preceding"
},
{
"trigger": "preceding-sibling::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "preceding-sibling"
},
{
"trigger": "self::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "self"
}
]
}
84 changes: 84 additions & 0 deletions Completions/XPath Axes.sublime-completions
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
// if current token is not an illegal axis, double colon does not yet exist and needs to be added
"scope": "source.xpath - source.xpath comment - source.xpath string - source.xpath invalid.illegal.axis",
"completions": [
{
"trigger": "ancestor::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "ancestor::"
},
{
"trigger": "ancestor-or-self::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "ancestor-or-self::"
},
{
"trigger": "attribute::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "attribute::"
},
{
"trigger": "child::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "child::"
},
{
"trigger": "descendant::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "descendant::"
},
{
"trigger": "descendant-or-self::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "descendant-or-self::"
},
{
"trigger": "following::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "following::"
},
{
"trigger": "following-sibling::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "following-sibling::"
},
{
"trigger": "namespace::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "namespace::"
},
{
"trigger": "parent::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "parent::"
},
{
"trigger": "preceding::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "preceding::"
},
{
"trigger": "preceding-sibling::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "preceding-sibling::"
},
{
"trigger": "self::",
"annotation": "XPath 1.0",
"kind": ["navigation", "a", "axis"],
"contents": "self::"
},
]
}
Loading

0 comments on commit 565b247

Please sign in to comment.