Skip to content

Commit

Permalink
Add GNU gettext PO grammar (#5996)
Browse files Browse the repository at this point in the history
  • Loading branch information
erasin authored Feb 20, 2023
1 parent b89b2ea commit 864ee8f
Show file tree
Hide file tree
Showing 4 changed files with 33 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 @@ -98,6 +98,7 @@
| pem || | | |
| perl |||| |
| php |||| `intelephense` |
| po ||| | |
| ponylang |||| |
| prisma || | | `prisma-language-server` |
| prolog | | | | `swipl` |
Expand Down
11 changes: 11 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2193,3 +2193,14 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "yuck"
source = { git = "https://github.com/Philipp-M/tree-sitter-yuck", rev = "9e97da5773f82123a8c8cccf8f7e795d140ed7d1" }

[[language]]
name = "po"
scope = "source.po"
file-types = ["po", "pot"]
roots = []
comment-token = "#"

[[grammar]]
name = "po"
source = { git = "https://github.com/erasin/tree-sitter-po", rev = "417cee9abb2053ed26b19e7de972398f2da9b29e" }
15 changes: 15 additions & 0 deletions runtime/queries/po/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
(msgctxt)
(msgid)
(msgid_plural)
(msgstr)
]@keyword

(comment) @comment
(comment (comment_reference (text) @string.special.path))
(comment (comment_flag (text) @label))

(number) @constant.numeric
(string) @string

(ERROR) @error
6 changes: 6 additions & 0 deletions runtime/queries/po/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(msgid) @parameter.inside

(comment) @comment.inside
(comment)+ @comment.around


0 comments on commit 864ee8f

Please sign in to comment.