on master help sign in
Add support for the BibTeX file format (#5064)
commitd14de277092d7eab555ea2abc1435101d12e308c authorFelipe S. S. Schneider <37125+schneiderfelipe@users.noreply.github.com> dateFri 9 Dec 2022, 01:33 (4 years ago) parent37e7dd1
5 files changed+76
book/src/generated/lang-support.md+1 languages.toml+28 runtime/queries/bibtex/highlights.scm+47 runtime/queries/bibtex/locals.scm runtime/queries/bibtex/tags.scm
book/src/generated/lang-support.md+1
@@ -5,6 +5,7 @@
55| bash | ✓ | | | `bash-language-server` |
66| bass | ✓ | | | `bass` |
77| beancount | ✓ | | | |
8+| bibtex | ✓ | | | `texlab` |
89| bicep | ✓ | | | `bicep-langserver` |
910| c | ✓ | ✓ | ✓ | `clangd` |
1011| c-sharp | ✓ | ✓ | | `OmniSharp` |
languages.toml+28
@@ -576,6 +576,34 @@ indent = { tab-width = 4, unit = "\t" }
576576name = "latex"
577577source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "8c75e93cd08ccb7ce1ccab22c1fbd6360e3bcea6" }
578578
579+[[language]]
580+name = "bibtex"
581+scope = "source.bib"
582+injection-regex = "bib"
583+file-types = ["bib"]
584+roots = []
585+comment-token = "%"
586+language-server = { command = "texlab" }
587+indent = { tab-width = 4, unit = "\t" }
588+auto-format = true
589+
590+[language.formatter]
591+command = 'bibtex-tidy'
592+args = [
593+ "-",
594+ "--curly",
595+ "--drop-all-caps",
596+ "--remove-empty-fields",
597+ "--sort-fields",
598+ "--sort=year,author,id",
599+ "--strip-enclosing-braces",
600+ "--trailing-commas",
601+]
602+
603+[[grammar]]
604+name = "bibtex"
605+source = { git = "https://github.com/latex-lsp/tree-sitter-bibtex", rev = "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" }
606+
579607[[language]]
580608name = "lean"
581609scope = "source.lean"
runtime/queries/bibtex/highlights.scmnew file+47
@@ -0,0 +1,47 @@
1+[
2+ (string_type)
3+ (preamble_type)
4+ (entry_type)
5+] @keyword
6+
7+[
8+ (junk)
9+ (comment)
10+] @comment
11+
12+[
13+ "="
14+ "#"
15+] @operator
16+
17+(command) @function.builtin
18+
19+(number) @constant.numeric
20+
21+(field
22+ name: (identifier) @variable.builtin)
23+
24+(token
25+ (identifier) @variable.parameter)
26+
27+[
28+ (brace_word)
29+ (quote_word)
30+] @string
31+
32+[
33+ (key_brace)
34+ (key_paren)
35+] @attribute
36+
37+(string
38+ name: (identifier) @constant)
39+
40+[
41+ "{"
42+ "}"
43+ "("
44+ ")"
45+] @punctuation.bracket
46+
47+"," @punctuation.delimiter
runtime/queries/bibtex/locals.scmnew file

No changes to the content.

runtime/queries/bibtex/tags.scmnew file

No changes to the content.