|
| 1 | +{ |
| 2 | + "$schema": "https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json", |
| 3 | + "parser_install_directories": ["deps/nvim-treesitter-data/parser", "${HOME}/.local/share/nvim/site/parser"], |
| 4 | + "parser_aliases": { |
| 5 | + "ecma": "javascript", |
| 6 | + "jsx": "javascript" |
| 7 | + }, |
| 8 | + "valid_captures": { |
| 9 | + "context": { |
| 10 | + "context": "specifies that the first line of this node will be used for the context", |
| 11 | + "context.start": "specifies that the context starts with the start of this node", |
| 12 | + "context.end": "specifies that the context ends before the start of this node", |
| 13 | + "context.final": "specifies that the context ends before the end of this node" |
| 14 | + } |
| 15 | + }, |
| 16 | + "valid_predicates": { |
| 17 | + "eq": { |
| 18 | + "any": true, |
| 19 | + "parameters": [ |
| 20 | + { |
| 21 | + "type": "capture", |
| 22 | + "arity": "required" |
| 23 | + }, |
| 24 | + { |
| 25 | + "type": "any", |
| 26 | + "arity": "required" |
| 27 | + } |
| 28 | + ], |
| 29 | + "description": "checks for equality between two nodes, or a node and a string" |
| 30 | + }, |
| 31 | + "any-of": { |
| 32 | + "parameters": [ |
| 33 | + { |
| 34 | + "type": "capture", |
| 35 | + "arity": "required" |
| 36 | + }, |
| 37 | + { |
| 38 | + "type": "string", |
| 39 | + "arity": "required" |
| 40 | + }, |
| 41 | + { |
| 42 | + "type": "string", |
| 43 | + "arity": "required" |
| 44 | + }, |
| 45 | + { |
| 46 | + "type": "string", |
| 47 | + "arity": "variadic" |
| 48 | + } |
| 49 | + ], |
| 50 | + "description": "match any of the given strings against the text corresponding to a node" |
| 51 | + }, |
| 52 | + "contains": { |
| 53 | + "any": true, |
| 54 | + "parameters": [ |
| 55 | + { |
| 56 | + "type": "capture", |
| 57 | + "arity": "required" |
| 58 | + }, |
| 59 | + { |
| 60 | + "type": "string", |
| 61 | + "arity": "required" |
| 62 | + }, |
| 63 | + { |
| 64 | + "type": "string", |
| 65 | + "arity": "variadic" |
| 66 | + } |
| 67 | + ], |
| 68 | + "description": "match a string against parts of the text corresponding to a node" |
| 69 | + }, |
| 70 | + "match": { |
| 71 | + "any": true, |
| 72 | + "parameters": [ |
| 73 | + { |
| 74 | + "type": "capture", |
| 75 | + "arity": "required" |
| 76 | + }, |
| 77 | + { |
| 78 | + "type": "string", |
| 79 | + "arity": "required" |
| 80 | + } |
| 81 | + ], |
| 82 | + "description": "Match a regexp against the text corresponding to a node" |
| 83 | + }, |
| 84 | + "lua-match": { |
| 85 | + "any": true, |
| 86 | + "parameters": [ |
| 87 | + { |
| 88 | + "type": "capture", |
| 89 | + "arity": "required" |
| 90 | + }, |
| 91 | + { |
| 92 | + "type": "string", |
| 93 | + "arity": "required" |
| 94 | + } |
| 95 | + ], |
| 96 | + "description": "match a Lua pattern against the text corresponding to a node" |
| 97 | + }, |
| 98 | + "has-ancestor": { |
| 99 | + "parameters": [ |
| 100 | + { |
| 101 | + "type": "capture", |
| 102 | + "arity": "required" |
| 103 | + }, |
| 104 | + { |
| 105 | + "type": "string", |
| 106 | + "arity": "required", |
| 107 | + "constraint": "named_node" |
| 108 | + }, |
| 109 | + { |
| 110 | + "type": "string", |
| 111 | + "arity": "variadic", |
| 112 | + "constraint": "named_node" |
| 113 | + } |
| 114 | + ], |
| 115 | + "description": "match any of the given node types against all ancestors of a node" |
| 116 | + }, |
| 117 | + "has-parent": { |
| 118 | + "parameters": [ |
| 119 | + { |
| 120 | + "type": "capture", |
| 121 | + "arity": "required" |
| 122 | + }, |
| 123 | + { |
| 124 | + "type": "string", |
| 125 | + "arity": "required", |
| 126 | + "constraint": "named_node" |
| 127 | + }, |
| 128 | + { |
| 129 | + "type": "string", |
| 130 | + "arity": "variadic", |
| 131 | + "constraint": "named_node" |
| 132 | + } |
| 133 | + ], |
| 134 | + "description": "match any of the given node types against the direct ancestor of a node" |
| 135 | + }, |
| 136 | + "kind-eq": { |
| 137 | + "parameters": [ |
| 138 | + { |
| 139 | + "type": "capture", |
| 140 | + "arity": "required" |
| 141 | + }, |
| 142 | + { |
| 143 | + "type": "string", |
| 144 | + "arity": "required", |
| 145 | + "constraint": "named_node" |
| 146 | + }, |
| 147 | + { |
| 148 | + "type": "string", |
| 149 | + "arity": "variadic", |
| 150 | + "constraint": "named_node" |
| 151 | + } |
| 152 | + ], |
| 153 | + "description": "checks whether a capture corresponds to a given set of nodes" |
| 154 | + } |
| 155 | + }, |
| 156 | + "valid_directives": { |
| 157 | + "set": { |
| 158 | + "parameters": [ |
| 159 | + { |
| 160 | + "type": "any", |
| 161 | + "arity": "required" |
| 162 | + }, |
| 163 | + { |
| 164 | + "type": "any", |
| 165 | + "arity": "optional" |
| 166 | + }, |
| 167 | + { |
| 168 | + "type": "any", |
| 169 | + "arity": "optional" |
| 170 | + } |
| 171 | + ], |
| 172 | + "description": "sets key/value metadata for a specific match or capture" |
| 173 | + }, |
| 174 | + "offset": { |
| 175 | + "parameters": [ |
| 176 | + { |
| 177 | + "type": "capture", |
| 178 | + "arity": "required" |
| 179 | + }, |
| 180 | + { |
| 181 | + "type": "string", |
| 182 | + "arity": "required", |
| 183 | + "constraint": "integer" |
| 184 | + }, |
| 185 | + { |
| 186 | + "type": "string", |
| 187 | + "arity": "required", |
| 188 | + "constraint": "integer" |
| 189 | + }, |
| 190 | + { |
| 191 | + "type": "string", |
| 192 | + "arity": "required", |
| 193 | + "constraint": "integer" |
| 194 | + }, |
| 195 | + { |
| 196 | + "type": "string", |
| 197 | + "arity": "required", |
| 198 | + "constraint": "integer" |
| 199 | + } |
| 200 | + ], |
| 201 | + "description": "Takes the range of the captured node and applies an offset. This will set a new range in the form of a list like { {start_row}, {start_col}, {end_row}, {end_col} } for the captured node with `capture_id` as `metadata[capture_id].range`." |
| 202 | + }, |
| 203 | + "gsub": { |
| 204 | + "parameters": [ |
| 205 | + { |
| 206 | + "type": "capture", |
| 207 | + "arity": "required" |
| 208 | + }, |
| 209 | + { |
| 210 | + "type": "string", |
| 211 | + "arity": "required" |
| 212 | + }, |
| 213 | + { |
| 214 | + "type": "string", |
| 215 | + "arity": "required" |
| 216 | + } |
| 217 | + ], |
| 218 | + "description": "Transforms the content of the node using a Lua pattern. This will set a new `metadata[capture_id].text`." |
| 219 | + }, |
| 220 | + "trim": { |
| 221 | + "parameters": [ |
| 222 | + { |
| 223 | + "type": "capture", |
| 224 | + "arity": "required" |
| 225 | + }, |
| 226 | + { |
| 227 | + "type": "string", |
| 228 | + "arity": "optional", |
| 229 | + "constraint": { |
| 230 | + "enum": ["0", "1"] |
| 231 | + } |
| 232 | + }, |
| 233 | + { |
| 234 | + "type": "string", |
| 235 | + "arity": "optional", |
| 236 | + "constraint": { |
| 237 | + "enum": ["0", "1"] |
| 238 | + } |
| 239 | + }, |
| 240 | + { |
| 241 | + "type": "string", |
| 242 | + "arity": "optional", |
| 243 | + "constraint": { |
| 244 | + "enum": ["0", "1"] |
| 245 | + } |
| 246 | + }, |
| 247 | + { |
| 248 | + "type": "string", |
| 249 | + "arity": "optional", |
| 250 | + "constraint": { |
| 251 | + "enum": ["0", "1"] |
| 252 | + } |
| 253 | + } |
| 254 | + ], |
| 255 | + "description": "Trims whitespace from the node. Sets a new `metadata[capture_id].range`. Takes a capture ID and, optionally, four integers to customize trimming behavior (`1` meaning trim, `0` meaning don't trim). When only given a capture ID, trims blank lines (lines that contain only whitespace, or are empty) from the end of the node (for backwards compatibility). Can trim all whitespace from both sides of the node if parameters are given." |
| 256 | + } |
| 257 | + } |
| 258 | +} |
0 commit comments