File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
name : Docs
2
2
3
- run-name : ${{github.event.workflow_run.head_commit.message}}
3
+ run-name : Update API docs
4
4
5
5
on :
6
6
workflow_run :
7
7
workflows : [CI]
8
8
types : [completed]
9
9
branches : [master]
10
+ push :
11
+ branches : [master]
12
+ paths :
13
+ - ktreesitter/README.md
10
14
11
15
concurrency :
12
16
cancel-in-progress : true
20
24
docs :
21
25
runs-on : ubuntu-latest
22
26
name : Publish docs on GitHub pages
23
- if : github.event.workflow_run.conclusion == 'success'
27
+ if : >-
28
+ github.event_name == 'push' ||
29
+ github.event.workflow_run.conclusion == 'success'
24
30
environment :
25
31
name : github-pages
26
32
url : ${{steps.deployment.outputs.page_url}}
Original file line number Diff line number Diff line change @@ -26,5 +26,5 @@ Some bundled languages that are relevant to Kotlin development.
26
26
[ tree-sitter ] : https://tree-sitter.github.io/tree-sitter/
27
27
[ ci ] : https://img.shields.io/github/actions/workflow/status/tree-sitter/kotlin-tree-sitter/ci.yml?logo=github&label=CI
28
28
[ central ] : https://img.shields.io/maven-central/v/io.github.tree-sitter/ktreesitter?logo=sonatype&label=Maven%20Central
29
- [ portal ] : https://img.shields.io/gradle-plugin-portal/v/io.github.treesitter .ktreesitter-plugin?logo=gradle&label=Gradle%20Plugin%20Portal
29
+ [ portal ] : https://img.shields.io/gradle-plugin-portal/v/io.github.tree-sitter .ktreesitter-plugin?logo=gradle&label=Gradle%20Plugin%20Portal
30
30
[ docs ] : https://img.shields.io/github/deployments/tree-sitter/kotlin-tree-sitter/github-pages?logo=kotlin&label=API%20Docs
Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ repositories {
26
26
## Basic usage
27
27
28
28
``` kotlin
29
- import io.github.treesitter.ktreesitter.*
30
- import io.github.treesitter.ktreesitter.java.TreeSitterJava
31
-
32
- val language = Language (TreeSitterJava .language())
29
+ val language = Language (TreeSitterKotlin .language())
33
30
val parser = Parser (language)
34
- val tree = parser.parse(" class Foo {}" )
31
+ val tree = parser.parse(" fun main() {}" )
32
+ val rootNode = tree.rootNode
35
33
36
- assert (tree.rootNode.type == " program" )
34
+ assert (rootNode.type == " source_file" )
35
+ assert (rootNode.startPoint.column == 0 )
36
+ assert (rootNode.endPoint.column == 13 )
37
37
```
38
38
39
39
[ tree-sitter ] : https://tree-sitter.github.io/tree-sitter/
You can’t perform that action at this time.
0 commit comments