Skip to content

Commit 43ccbd5

Browse files
committed
add custom ast shim to filters called by IDEs
1 parent 60edc74 commit 43ccbd5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- customastshim.lua
2+
-- Copyright (C) 2020-2023 Posit Software, PBC
3+
4+
_quarto = {
5+
ast = {
6+
walk = function(el, filter)
7+
return el:walk(filter)
8+
end
9+
}
10+
}

src/resources/filters/crossref/crossref.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ import("../common/meta.lua")
4545
import("../common/table.lua")
4646
import("../common/string.lua")
4747
import("../common/debug.lua")
48+
49+
import("../common/customastshim.lua")
4850
-- [/import]
4951

52+
-- note that the custom-ast-shim.lua import should _not_ happen on main.lua
53+
5054
initCrossrefIndex()
5155

5256
-- chain of filters

src/resources/filters/quarto-init/quarto-init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ import("../common/filemetadata.lua")
1616
import("../common/meta.lua")
1717
import("includes.lua")
1818
import("resourcerefs.lua")
19+
import("../common/customastshim.lua")
20+
1921
-- [/import]
2022

23+
-- note that the custom-ast-shim.lua import should _not_ happen on main.lua
24+
-- it exists for us to be able to support filters that need to exist on IDE
25+
-- and do not require the full custom AST work.
26+
2127
return {
2228
readIncludes(),
2329
combineFilters({

0 commit comments

Comments
 (0)