File tree Expand file tree Collapse file tree 5 files changed +66
-0
lines changed
Expand file tree Collapse file tree 5 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 147147| log | ✓ | | | | |
148148| lpf | ✓ | | | | |
149149| lua | ✓ | ✓ | ✓ | | ` lua-language-server ` |
150+ | lua-format-string | ✓ | | | | |
150151| luau | ✓ | ✓ | ✓ | | ` luau-lsp ` |
151152| mail | ✓ | ✓ | | | |
152153| make | ✓ | | ✓ | | |
Original file line number Diff line number Diff line change @@ -1416,6 +1416,16 @@ language-servers = [ "lua-language-server" ]
14161416name = " lua"
14171417source = { git = " https://github.com/tree-sitter-grammars/tree-sitter-lua" , rev = " 88e446476a1e97a8724dff7a23e2d709855077f2" }
14181418
1419+ [[language ]]
1420+ name = " lua-format-string"
1421+ scope = " source.lua-format-string"
1422+ file-types = []
1423+ injection-regex = " lua-format-string"
1424+
1425+ [[grammar ]]
1426+ name = " lua-format-string"
1427+ source = { git = " https://codeberg.org/kpbaks/tree-sitter-lua-format-string" , rev = " b667c8cab109df307e1b4d56b0b43f5c4a353533" }
1428+
14191429[[grammar ]]
14201430name = " teal"
14211431source = { git = " https://github.com/euclidianAce/tree-sitter-teal" , rev = " 3db655924b2ff1c54fdf6371b5425ea6b5dccefe" }
Original file line number Diff line number Diff line change 1+ (escaped_percent_sign) @constant.character.escape
2+
3+ (flag) @constant.builtin
4+
5+ (text) @string
6+
7+ (width) @constant.numeric.integer
8+ (precision) @constant.numeric.float
9+
10+ (conversion_specifier) @type
11+
12+ "." @punctuation.delimiter
13+ "%" @punctuation.special
Original file line number Diff line number Diff line change 11((comment) @injection.content
22 (#set! injection.language "comment")
33 (#set! injection.include-children))
4+
5+ ; string.format("format string", ...)
6+ ((function_call
7+ name: (dot_index_expression
8+ table: (identifier) @_table
9+ field: (identifier) @_function )
10+ arguments: (arguments
11+ .
12+ (string
13+ content: (string_content) @injection.content )))
14+ (#eq? @_table "string")
15+ (#eq? @_function "format")
16+ (#set! injection.language "lua-format-string"))
17+
18+ ; ("format"):format(...)
19+ ((function_call
20+ name: (method_index_expression
21+ table: (parenthesized_expression
22+ (string
23+ content: (string_content) @injection.content ))
24+ method: (identifier) @_function ))
25+ (#eq? @_function "format")
26+ (#set! injection.language "lua-format-string"))
Original file line number Diff line number Diff line change 11((comment) @injection.content
22 (#set! injection.language "comment"))
3+
4+ ; string.format("format string", ...)
5+ ((call_stmt
6+ invoked: (var
7+ table_name: (name) @_table
8+ (key
9+ field_name: (name) @_function ))
10+ (arglist
11+ . (string) @injection.content ))
12+ (#eq? @_table "string")
13+ (#eq? @_function "format")
14+ (#set! injection.language "lua-format-string"))
15+
16+ ; ("format"):format(...)
17+ ((call_stmt
18+ method_table: (exp_wrap (string) @injection.content )
19+ method_name: (name) @_function )
20+ (#eq? @_function "format")
21+ (#set! injection.language "lua-format-string"))
You can’t perform that action at this time.
0 commit comments