Skip to content

Commit

Permalink
Add support for reStructuredText (helix-editor#6180)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrvidal authored and wes-adams committed Jul 3, 2023
1 parent fbcf911 commit 7052b32
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
| rescript ||| | `rescript-language-server` |
| rmarkdown || || `R` |
| ron || || |
| rst || | | |
| ruby |||| `solargraph` |
| rust |||| `rust-analyzer` |
| sage ||| | |
Expand Down
11 changes: 11 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2244,3 +2244,14 @@ indent = { tab-width = 8, unit = " " }
[[grammar]]
name = "nasm"
source = { git = "https://github.com/naclsn/tree-sitter-nasm", rev = "a0db15db6fcfb1bf2cc8702500e55e558825c48b" }

[[language]]
name = "rst"
scope = "source.rst"
comment-token = ".."
file-types = ["rst"]
roots = []

[[grammar]]
name = "rst"
source = { git = "https://github.com/stsewd/tree-sitter-rst", rev = "25e6328872ac3a764ba8b926aea12719741103f1" }
38 changes: 38 additions & 0 deletions runtime/queries/rst/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(comment) @comment

[
(title)
] @markup.heading.1

[
"adornment"
] @markup.heading.marker

[
(target)
(reference)
] @markup.link.url

[
"bullet"
] @markup.list.unnumbered

(strong) @markup.bold
(emphasis) @markup.italic
(literal) @markup.raw.inline

(list_item
(term) @markup.bold
(classifier)? @markup.italic)

(directive
[".." (type) "::"] @function
)

(field
[":" (field_name) ":"] @variable.other.member
)

(interpreted_text) @markup.raw.inline

(interpreted_text (role)) @keyword

0 comments on commit 7052b32

Please sign in to comment.