aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/gen_declarations.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-22 13:32:46 +0800
committerGitHub <noreply@github.com>2023-12-22 13:32:46 +0800
commitba0fa4fa197330687b06c74a50b2ccd4800f5881 (patch)
tree13c4be404f1a3e3480a555d06ff627cb6002c5c4 /src/nvim/generators/gen_declarations.lua
parent089b934352437ab310a6dd3b138c7ed9445a3d7b (diff)
downloadrneovim-ba0fa4fa197330687b06c74a50b2ccd4800f5881.tar.gz
rneovim-ba0fa4fa197330687b06c74a50b2ccd4800f5881.tar.bz2
rneovim-ba0fa4fa197330687b06c74a50b2ccd4800f5881.zip
refactor(IWYU): add "private" pragma to more generated headers (#26706)
"export" only prevents IWYU from adding these headers if the headers that export them are included, while "private" ensures that IWYU never adds these headers.
Diffstat (limited to 'src/nvim/generators/gen_declarations.lua')
-rw-r--r--src/nvim/generators/gen_declarations.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/generators/gen_declarations.lua b/src/nvim/generators/gen_declarations.lua
index 9fd2750f52..5d1e586fe6 100644
--- a/src/nvim/generators/gen_declarations.lua
+++ b/src/nvim/generators/gen_declarations.lua
@@ -207,6 +207,22 @@ if fname:find('.*/src/nvim/.*%.c$') then
// IWYU pragma: private, include "%s"
]]):format(header_fname:gsub('.*/src/nvim/', 'nvim/')) .. non_static
end
+elseif non_static_fname:find('/include/api/private/dispatch_wrappers%.h%.generated%.h$') then
+ non_static = [[
+// IWYU pragma: private, include "nvim/api/private/dispatch.h"
+]] .. non_static
+elseif non_static_fname:find('/include/ui_events_call%.h%.generated%.h$') then
+ non_static = [[
+// IWYU pragma: private, include "nvim/ui.h"
+]] .. non_static
+elseif non_static_fname:find('/include/ui_events_client%.h%.generated%.h$') then
+ non_static = [[
+// IWYU pragma: private, include "nvim/ui_client.h"
+]] .. non_static
+elseif non_static_fname:find('/include/ui_events_remote%.h%.generated%.h$') then
+ non_static = [[
+// IWYU pragma: private, include "nvim/api/ui.h"
+]] .. non_static
end
local filepattern = '^#%a* (%d+) "([^"]-)/?([^"/]+)"'