-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix treesitter formatting of inlines.
- Loading branch information
1 parent
8dd9339
commit a4444e6
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
function process(textTree) | ||
local builder = LuaTextBuilder.new() | ||
local luaBuilder = LuaTextBuilder.new() | ||
local regoBuilder = RegoTextBuilder.new() | ||
textTree:match("lua", function(lua) | ||
return {TextTree.new("code"):take_children(builder:process_string(lua:text(), ""))} | ||
return luaBuilder:process_string(lua:text(), ""):extract_children() | ||
end) | ||
textTree:match("rego", function(lua) | ||
return {TextTree.new("code"):take_children(builder:process_string(lua:text(), ""))} | ||
textTree:match("rego", function(rego) | ||
return regoBuilder:process_string(rego:text(), ""):extract_children() | ||
end) | ||
return textTree | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters