1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! Bundled tree-sitter highlight, injection, locals, tags, indents, and folds queries.
//!
//! Queries are embedded from `parsers/{lang}/queries/*.scm` at build time.
//! Not all languages have queries — returns `None` for languages without bundled queries.
include!;
/// Get the highlights query for a language, if bundled.
///
/// Returns the contents of `highlights.scm` as a static string, or `None`
/// if no highlights query is bundled for this language.
///
/// # Example
///
/// ```
/// use tree_sitter_language_pack::get_highlights_query;
///
/// // Returns Some(...) for languages with bundled queries
/// let query = get_highlights_query("python");
/// // Returns None for languages without bundled highlights queries
/// let missing = get_highlights_query("nonexistent_lang");
/// assert!(missing.is_none());
/// ```
/// Get the injections query for a language, if bundled.
///
/// Returns the contents of `injections.scm` as a static string, or `None`
/// if no injections query is bundled for this language.
///
/// # Example
///
/// ```
/// use tree_sitter_language_pack::get_injections_query;
///
/// let query = get_injections_query("markdown");
/// // Returns None for languages without bundled injections queries
/// let missing = get_injections_query("nonexistent_lang");
/// assert!(missing.is_none());
/// ```
/// Get the locals query for a language, if bundled.
///
/// Returns the contents of `locals.scm` as a static string, or `None`
/// if no locals query is bundled for this language.
///
/// # Example
///
/// ```
/// use tree_sitter_language_pack::get_locals_query;
///
/// let query = get_locals_query("python");
/// // Returns None for languages without bundled locals queries
/// let missing = get_locals_query("nonexistent_lang");
/// assert!(missing.is_none());
/// ```
/// Get the tags query for a language, if bundled.
///
/// Returns the contents of `tags.scm` as a static string, or `None`
/// if no tags query is bundled for this language.
///
/// # Example
///
/// ```
/// use tree_sitter_language_pack::get_tags_query;
///
/// let query = get_tags_query("rust");
/// // Returns None for languages without bundled tags queries
/// let missing = get_tags_query("nonexistent_lang");
/// assert!(missing.is_none());
/// ```
/// Get the indents query for a language, if bundled.
///
/// Returns the contents of `indents.scm` (used for auto-indentation) as a static
/// string, or `None` if no indents query is bundled for this language.
///
/// # Example
///
/// ```
/// use tree_sitter_language_pack::get_indents_query;
///
/// let query = get_indents_query("objc");
/// // Returns None for languages without bundled indents queries
/// let missing = get_indents_query("nonexistent_lang");
/// assert!(missing.is_none());
/// ```
/// Get the folds query for a language, if bundled.
///
/// Returns the contents of `folds.scm` (used for code folding) as a static string,
/// or `None` if no folds query is bundled for this language.
///
/// # Example
///
/// ```
/// use tree_sitter_language_pack::get_folds_query;
///
/// let query = get_folds_query("rust");
/// // Returns None for languages without bundled folds queries
/// let missing = get_folds_query("nonexistent_lang");
/// assert!(missing.is_none());
/// ```