Closed scottming closed 1 year ago
You could write your own provider, a function returning the folding range based on your own requirement.
Here is a collection of examples. Also, you may get inspired by checking other issues where other users discussed and shared their ideas regarding how to customize a provider (e.g., https://github.com/kevinhwang91/nvim-ufo/issues/125)
diff --git a/queries/lua/folds.scm b/queries/lua/folds.scm
index d8f0b42d..934bd9a8 100644
--- a/queries/lua/folds.scm
+++ b/queries/lua/folds.scm
@@ -8,3 +8,5 @@
(function_definition)
(table_constructor)
] @fold
+
+(expression_list value: (string) @fold)
h vim.treesitter.query.set
Feature description
I want to fold the string like this(starts with
[[
):Describe the solution you'd like
local local_call_query_scm = [[...]]
Additional context
This is my ufo setup
I've checked https://github.com/nvim-treesitter/nvim-treesitter/issues/3326
but I don't know how to write a query to determine there's a multiple lines string quoted in
[[]]
.