aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/generated/lang-support.md1
-rw-r--r--languages.toml28
-rw-r--r--runtime/queries/bibtex/highlights.scm47
-rw-r--r--runtime/queries/bibtex/locals.scm0
-rw-r--r--runtime/queries/bibtex/tags.scm0
5 files changed, 76 insertions, 0 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index ccfd18c0..28dafd7a 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -5,6 +5,7 @@
| bash | ✓ | | | `bash-language-server` |
| bass | ✓ | | | `bass` |
| beancount | ✓ | | | |
+| bibtex | ✓ | | | `texlab` |
| bicep | ✓ | | | `bicep-langserver` |
| c | ✓ | ✓ | ✓ | `clangd` |
| c-sharp | ✓ | ✓ | | `OmniSharp` |
diff --git a/languages.toml b/languages.toml
index 325a39df..96d92ce8 100644
--- a/languages.toml
+++ b/languages.toml
@@ -577,6 +577,34 @@ name = "latex"
source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "8c75e93cd08ccb7ce1ccab22c1fbd6360e3bcea6" }
[[language]]
+name = "bibtex"
+scope = "source.bib"
+injection-regex = "bib"
+file-types = ["bib"]
+roots = []
+comment-token = "%"
+language-server = { command = "texlab" }
+indent = { tab-width = 4, unit = "\t" }
+auto-format = true
+
+[language.formatter]
+command = 'bibtex-tidy'
+args = [
+ "-",
+ "--curly",
+ "--drop-all-caps",
+ "--remove-empty-fields",
+ "--sort-fields",
+ "--sort=year,author,id",
+ "--strip-enclosing-braces",
+ "--trailing-commas",
+]
+
+[[grammar]]
+name = "bibtex"
+source = { git = "https://github.com/latex-lsp/tree-sitter-bibtex", rev = "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" }
+
+[[language]]
name = "lean"
scope = "source.lean"
injection-regex = "lean"
diff --git a/runtime/queries/bibtex/highlights.scm b/runtime/queries/bibtex/highlights.scm
new file mode 100644
index 00000000..db1ab70c
--- /dev/null
+++ b/runtime/queries/bibtex/highlights.scm
@@ -0,0 +1,47 @@
+[
+ (string_type)
+ (preamble_type)
+ (entry_type)
+] @keyword
+
+[
+ (junk)
+ (comment)
+] @comment
+
+[
+ "="
+ "#"
+] @operator
+
+(command) @function.builtin
+
+(number) @constant.numeric
+
+(field
+ name: (identifier) @variable.builtin)
+
+(token
+ (identifier) @variable.parameter)
+
+[
+ (brace_word)
+ (quote_word)
+] @string
+
+[
+ (key_brace)
+ (key_paren)
+] @attribute
+
+(string
+ name: (identifier) @constant)
+
+[
+ "{"
+ "}"
+ "("
+ ")"
+] @punctuation.bracket
+
+"," @punctuation.delimiter
diff --git a/runtime/queries/bibtex/locals.scm b/runtime/queries/bibtex/locals.scm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/runtime/queries/bibtex/locals.scm
diff --git a/runtime/queries/bibtex/tags.scm b/runtime/queries/bibtex/tags.scm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/runtime/queries/bibtex/tags.scm