diff --git a/Makefile b/Makefile index 8d6acd94f0..0ce89ae39f 100644 --- a/Makefile +++ b/Makefile @@ -262,7 +262,6 @@ iwyu: build/.ran-cmake |src/nvim/os/fs.h\ |src/nvim/os/input.h\ |src/nvim/os/lang.h\ - |src/nvim/os/os.h\ |src/nvim/os/pty_conpty_win.h\ |src/nvim/os/pty_process_unix.h\ |src/nvim/os/pty_process_win.h\ diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp index 5f79addf04..ae857e87da 100644 --- a/cmake.config/iwyu/mapping.imp +++ b/cmake.config/iwyu/mapping.imp @@ -2,185 +2,16 @@ { ref: "c99.imp" }, { ref: "posix.imp" }, - # Generated to normal headers: header.h.generated.h -> nvim/header.h - { include: [ '"api/autocmd.h.generated.h"', private, '"nvim/api/autocmd.h"', public ] }, - { include: [ '"api/buffer.h.generated.h"', private, '"nvim/api/buffer.h"', public ] }, - { include: [ '"api/command.h.generated.h"', private, '"nvim/api/command.h"', public ] }, - { include: [ '"api/deprecated.h.generated.h"', private, '"nvim/api/deprecated.h"', public ] }, - { include: [ '"api/extmark.h.generated.h"', private, '"nvim/api/extmark.h"', public ] }, - { include: [ '"api/options.h.generated.h"', private, '"nvim/api/options.h"', public ] }, - { include: [ '"api/private/converter.h.generated.h"', private, '"nvim/api/private/converter.h"', public ] }, - { include: [ '"api/private/dispatch.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, - { include: [ '"api/private/helpers.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, - { include: [ '"api/private/validate.h.generated.h"', private, '"nvim/api/private/validate.h"', public ] }, - { include: [ '"api/tabpage.h.generated.h"', private, '"nvim/api/tabpage.h"', public ] }, - { include: [ '"api/ui.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, - { include: [ '"api/vim.h.generated.h"', private, '"nvim/api/vim.h"', public ] }, - { include: [ '"api/vimscript.h.generated.h"', private, '"nvim/api/vimscript.h"', public ] }, - { include: [ '"api/win_config.h.generated.h"', private, '"nvim/api/win_config.h"', public ] }, - { include: [ '"api/window.h.generated.h"', private, '"nvim/api/window.h"', public ] }, - { include: [ '"arabic.h.generated.h"', private, '"nvim/arabic.h"', public ] }, - { include: [ '"arglist.h.generated.h"', private, '"nvim/arglist.h"', public ] }, - { include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] }, - { include: [ '"base64.h.generated.h"', private, '"nvim/base64.h"', public ] }, - { include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] }, - { include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] }, - { include: [ '"bufwrite.h.generated.h"', private, '"nvim/bufwrite.h"', public ] }, - { include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] }, - { include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] }, - { include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] }, - { include: [ '"cmdexpand.h.generated.h"', private, '"nvim/cmdexpand.h"', public ] }, - { include: [ '"cmdhist.h.generated.h"', private, '"nvim/cmdhist.h"', public ] }, - { include: [ '"context.h.generated.h"', private, '"nvim/context.h"', public ] }, - { include: [ '"cursor.h.generated.h"', private, '"nvim/cursor.h"', public ] }, - { include: [ '"cursor_shape.h.generated.h"', private, '"nvim/cursor_shape.h"', public ] }, - { include: [ '"debugger.h.generated.h"', private, '"nvim/debugger.h"', public ] }, - { include: [ '"decoration.h.generated.h"', private, '"nvim/decoration.h"', public ] }, - { include: [ '"decoration_provider.h.generated.h"', private, '"nvim/decoration_provider.h"', public ] }, - { include: [ '"diff.h.generated.h"', private, '"nvim/diff.h"', public ] }, - { include: [ '"digraph.h.generated.h"', private, '"nvim/digraph.h"', public ] }, - { include: [ '"drawline.h.generated.h"', private, '"nvim/drawline.h"', public ] }, - { include: [ '"drawscreen.h.generated.h"', private, '"nvim/drawscreen.h"', public ] }, - { include: [ '"edit.h.generated.h"', private, '"nvim/edit.h"', public ] }, - { include: [ '"eval.h.generated.h"', private, '"nvim/eval.h"', public ] }, - { include: [ '"eval/buffer.h.generated.h"', private, '"nvim/eval/buffer.h"', public ] }, - { include: [ '"eval/decode.h.generated.h"', private, '"nvim/eval/decode.h"', public ] }, - { include: [ '"eval/encode.h.generated.h"', private, '"nvim/eval/encode.h"', public ] }, - { include: [ '"eval/executor.h.generated.h"', private, '"nvim/eval/executor.h"', public ] }, - { include: [ '"eval/funcs.h.generated.h"', private, '"nvim/eval/funcs.h"', public ] }, - { include: [ '"eval/typval.h.generated.h"', private, '"nvim/eval/typval.h"', public ] }, - { include: [ '"eval/userfunc.h.generated.h"', private, '"nvim/eval/userfunc.h"', public ] }, - { include: [ '"eval/vars.h.generated.h"', private, '"nvim/eval/vars.h"', public ] }, - { include: [ '"eval/window.h.generated.h"', private, '"nvim/eval/window.h"', public ] }, - { include: [ '"event/libuv_process.h.generated.h"', private, '"nvim/event/libuv_process.h"', public ] }, - { include: [ '"event/loop.h.generated.h"', private, '"nvim/event/loop.h"', public ] }, - { include: [ '"event/multiqueue.h.generated.h"', private, '"nvim/event/multiqueue.h"', public ] }, - { include: [ '"event/process.h.generated.h"', private, '"nvim/event/process.h"', public ] }, - { include: [ '"event/rstream.h.generated.h"', private, '"nvim/event/rstream.h"', public ] }, - { include: [ '"event/signal.h.generated.h"', private, '"nvim/event/signal.h"', public ] }, - { include: [ '"event/socket.h.generated.h"', private, '"nvim/event/socket.h"', public ] }, - { include: [ '"event/stream.h.generated.h"', private, '"nvim/event/stream.h"', public ] }, - { include: [ '"event/time.h.generated.h"', private, '"nvim/event/time.h"', public ] }, - { include: [ '"event/wstream.h.generated.h"', private, '"nvim/event/wstream.h"', public ] }, - { include: [ '"ex_cmds.h.generated.h"', private, '"nvim/ex_cmds.h"', public ] }, - { include: [ '"ex_cmds2.h.generated.h"', private, '"nvim/ex_cmds2.h"', public ] }, - { include: [ '"ex_docmd.h.generated.h"', private, '"nvim/ex_docmd.h"', public ] }, - { include: [ '"ex_eval.h.generated.h"', private, '"nvim/ex_eval.h"', public ] }, - { include: [ '"ex_getln.h.generated.h"', private, '"nvim/ex_getln.h"', public ] }, - { include: [ '"ex_session.h.generated.h"', private, '"nvim/ex_session.h"', public ] }, - { include: [ '"extmark.h.generated.h"', private, '"nvim/extmark.h"', public ] }, - { include: [ '"file_search.h.generated.h"', private, '"nvim/file_search.h"', public ] }, - { include: [ '"fileio.h.generated.h"', private, '"nvim/fileio.h"', public ] }, - { include: [ '"fold.h.generated.h"', private, '"nvim/fold.h"', public ] }, - { include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] }, - { include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] }, - { include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] }, - { include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] }, - { include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] }, - { include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] }, - { include: [ '"highlight_group.h.generated.h"', private, '"nvim/highlight_group.h"', public ] }, - { include: [ '"if_cscope.h.generated.h"', private, '"nvim/if_cscope.h"', public ] }, - { include: [ '"indent.h.generated.h"', private, '"nvim/indent.h"', public ] }, - { include: [ '"indent_c.h.generated.h"', private, '"nvim/indent_c.h"', public ] }, - { include: [ '"input.h.generated.h"', private, '"nvim/input.h"', public ] }, - { include: [ '"insexpand.h.generated.h"', private, '"nvim/insexpand.h"', public ] }, - { include: [ '"keycodes.h.generated.h"', private, '"nvim/keycodes.h"', public ] }, - { include: [ '"linematch.h.generated.h"', private, '"nvim/linematch.h"', public ] }, - { include: [ '"locale.h.generated.h"', private, '"nvim/locale.h"', public ] }, - { include: [ '"log.h.generated.h"', private, '"nvim/log.h"', public ] }, - { include: [ '"lua/base64.h.generated.h"', private, '"nvim/lua/base64.h"', public ] }, - { include: [ '"lua/converter.h.generated.h"', private, '"nvim/lua/converter.h"', public ] }, - { include: [ '"lua/executor.h.generated.h"', private, '"nvim/lua/executor.h"', public ] }, - { include: [ '"lua/secure.h.generated.h"', private, '"nvim/lua/secure.h"', public ] }, - { include: [ '"lua/spell.h.generated.h"', private, '"nvim/lua/spell.h"', public ] }, - { include: [ '"lua/stdlib.h.generated.h"', private, '"nvim/lua/stdlib.h"', public ] }, - { include: [ '"lua/treesitter.h.generated.h"', private, '"nvim/lua/treesitter.h"', public ] }, - { include: [ '"lua/xdiff.h.generated.h"', private, '"nvim/lua/xdiff.h"', public ] }, - { include: [ '"main.h.generated.h"', private, '"nvim/main.h"', public ] }, - { include: [ '"mapping.h.generated.h"', private, '"nvim/mapping.h"', public ] }, - { include: [ '"mark.h.generated.h"', private, '"nvim/mark.h"', public ] }, - { include: [ '"marktree.h.generated.h"', private, '"nvim/marktree.h"', public ] }, - { include: [ '"match.h.generated.h"', private, '"nvim/match.h"', public ] }, - { include: [ '"math.h.generated.h"', private, '"nvim/math.h"', public ] }, - { include: [ '"mbyte.h.generated.h"', private, '"nvim/mbyte.h"', public ] }, - { include: [ '"memfile.h.generated.h"', private, '"nvim/memfile.h"', public ] }, - { include: [ '"memline.h.generated.h"', private, '"nvim/memline.h"', public ] }, - { include: [ '"memory.h.generated.h"', private, '"nvim/memory.h"', public ] }, - { include: [ '"menu.h.generated.h"', private, '"nvim/menu.h"', public ] }, - { include: [ '"message.h.generated.h"', private, '"nvim/message.h"', public ] }, - { include: [ '"mouse.h.generated.h"', private, '"nvim/mouse.h"', public ] }, - { include: [ '"move.h.generated.h"', private, '"nvim/move.h"', public ] }, - { include: [ '"msgpack_rpc/channel.h.generated.h"', private, '"nvim/msgpack_rpc/channel.h"', public ] }, - { include: [ '"msgpack_rpc/helpers.h.generated.h"', private, '"nvim/msgpack_rpc/helpers.h"', public ] }, - { include: [ '"msgpack_rpc/server.h.generated.h"', private, '"nvim/msgpack_rpc/server.h"', public ] }, - { include: [ '"msgpack_rpc/unpacker.h.generated.h"', private, '"nvim/msgpack_rpc/unpacker.h"', public ] }, - { include: [ '"normal.h.generated.h"', private, '"nvim/normal.h"', public ] }, - { include: [ '"ops.h.generated.h"', private, '"nvim/ops.h"', public ] }, - { include: [ '"option.h.generated.h"', private, '"nvim/option.h"', public ] }, - { include: [ '"optionstr.h.generated.h"', private, '"nvim/optionstr.h"', public ] }, - { include: [ '"os/dl.h.generated.h"', private, '"nvim/os/dl.h"', public ] }, - { include: [ '"os/fileio.h.generated.h"', private, '"nvim/os/fileio.h"', public ] }, - { include: [ '"os/fs.h.generated.h"', private, '"nvim/os/fs.h"', public ] }, - { include: [ '"os/input.h.generated.h"', private, '"nvim/os/input.h"', public ] }, - { include: [ '"os/lang.h.generated.h"', private, '"nvim/os/lang.h"', public ] }, - { include: [ '"os/process.h.generated.h"', private, '"nvim/os/process.h"', public ] }, - { include: [ '"os/pty_process_unix.h.generated.h"', private, '"nvim/os/pty_process_unix.h"', private ] }, - { include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] }, - { include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] }, - { include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] }, - { include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] }, - { include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] }, - { include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] }, - { include: [ '"profile.h.generated.h"', private, '"nvim/profile.h"', public ] }, - { include: [ '"quickfix.h.generated.h"', private, '"nvim/quickfix.h"', public ] }, - { include: [ '"rbuffer.h.generated.h"', private, '"nvim/rbuffer.h"', public ] }, - { include: [ '"regexp.h.generated.h"', private, '"nvim/regexp.h"', public ] }, - { include: [ '"runtime.h.generated.h"', private, '"nvim/runtime.h"', public ] }, - { include: [ '"screen.h.generated.h"', private, '"nvim/screen.h"', public ] }, - { include: [ '"search.h.generated.h"', private, '"nvim/search.h"', public ] }, - { include: [ '"sha256.h.generated.h"', private, '"nvim/sha256.h"', public ] }, - { include: [ '"shada.h.generated.h"', private, '"nvim/shada.h"', public ] }, - { include: [ '"sign.h.generated.h"', private, '"nvim/sign.h"', public ] }, - { include: [ '"spell.h.generated.h"', private, '"nvim/spell.h"', public ] }, - { include: [ '"spellfile.h.generated.h"', private, '"nvim/spellfile.h"', public ] }, - { include: [ '"spellsuggest.h.generated.h"', private, '"nvim/spellsuggest.h"', public ] }, - { include: [ '"state.h.generated.h"', private, '"nvim/state.h"', public ] }, - { include: [ '"statusline.h.generated.h"', private, '"nvim/statusline.h"', public ] }, - { include: [ '"strings.h.generated.h"', private, '"nvim/strings.h"', public ] }, - { include: [ '"syntax.h.generated.h"', private, '"nvim/syntax.h"', public ] }, - { include: [ '"tag.h.generated.h"', private, '"nvim/tag.h"', public ] }, - { include: [ '"terminal.h.generated.h"', private, '"nvim/terminal.h"', public ] }, - { include: [ '"testing.h.generated.h"', private, '"nvim/testing.h"', public ] }, - { include: [ '"textformat.h.generated.h"', private, '"nvim/textformat.h"', public ] }, - { include: [ '"textobject.h.generated.h"', private, '"nvim/textobject.h"', public ] }, - { include: [ '"tui/input.h.generated.h"', private, '"nvim/tui/input.h"', public ] }, - { include: [ '"tui/terminfo.h.generated.h"', private, '"nvim/tui/terminfo.h"', public ] }, - { include: [ '"tui/tui.h.generated.h"', private, '"nvim/tui/tui.h"', public ] }, - { include: [ '"ugrid.h.generated.h"', private, '"nvim/ugrid.h"', public ] }, - { include: [ '"ui.h.generated.h"', private, '"nvim/ui.h"', public ] }, - { include: [ '"ui_bridge.h.generated.h"', private, '"nvim/ui_bridge.h"', public ] }, - { include: [ '"ui_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, - { include: [ '"ui_compositor.h.generated.h"', private, '"nvim/ui_compositor.h"', public ] }, - { include: [ '"undo.h.generated.h"', private, '"nvim/undo.h"', public ] }, - { include: [ '"usercmd.h.generated.h"', private, '"nvim/usercmd.h"', public ] }, - { include: [ '"version.h.generated.h"', private, '"nvim/version.h"', public ] }, - { include: [ '"viml/parser/expressions.h.generated.h"', private, '"nvim/viml/parser/expressions.h"', public ] }, - { include: [ '"viml/parser/parser.h.generated.h"', private, '"nvim/viml/parser/parser.h"', public ] }, - { include: [ '"window.h.generated.h"', private, '"nvim/window.h"', public ] }, - { include: [ '"winfloat.h.generated.h"', private, '"nvim/winfloat.h"', public ] }, - # Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h { include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, { include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, { include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] }, { include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] }, - { include: [ '"os/fs.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] }, { include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, - { include: [ '"ui_events_remote.generated.h"', private, '"nvim/api/ui.h"', public ] }, { include: [ '"ui_events_remote.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, # Symbols diff --git a/src/clint.py b/src/clint.py index d853428cd0..13c2978cf4 100755 --- a/src/clint.py +++ b/src/clint.py @@ -1017,7 +1017,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/os/fs.h", "src/nvim/os/input.h", "src/nvim/os/lang.h", - "src/nvim/os/os.h", "src/nvim/os/pty_conpty_win.h", "src/nvim/os/pty_process_unix.h", "src/nvim/os/pty_process_win.h", diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index bbeaa452ba..828362c10e 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -1,10 +1,10 @@ #include -#include #include #include #include #include #include +#include #include #include #include @@ -17,6 +17,7 @@ #include "nvim/ascii.h" #include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" #include "nvim/ex_eval.h" #include "nvim/garray.h" diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 9df886ef9a..8526147287 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -78,7 +78,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index 96211f855c..ab57d5d754 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -35,7 +35,7 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 9b40a17d20..7a6cc02cb8 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -46,6 +46,7 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/lang.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 9c75a21b2c..03103ecd65 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -46,7 +46,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" #include "nvim/path.h" diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a4b6a5fc11..52ab610267 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -60,7 +60,7 @@ #include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fileio.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/lang.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 98deb7b32b..53fad45d04 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -90,7 +90,7 @@ #include "nvim/optionstr.h" #include "nvim/os/dl.h" #include "nvim/os/fileio.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/os/pty_process.h" #include "nvim/os/shell.h" diff --git a/src/nvim/eval/window.h b/src/nvim/eval/window.h index 8502978ac1..fa9b9c41d4 100644 --- a/src/nvim/eval/window.h +++ b/src/nvim/eval/window.h @@ -11,7 +11,7 @@ #include "nvim/mark.h" #include "nvim/option_defs.h" #include "nvim/option_vars.h" -#include "nvim/os/os.h" +#include "nvim/os/fs.h" #include "nvim/pos.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 542fb707fd..6fe6548f99 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -14,6 +14,7 @@ #include "nvim/log.h" #include "nvim/main.h" #include "nvim/memory.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 267137cd0a..d77bd47fcf 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -65,7 +65,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 0171023fc5..373dd8cd96 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -61,6 +61,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c index 1a36014378..903170a43c 100644 --- a/src/nvim/ex_session.c +++ b/src/nvim/ex_session.c @@ -29,6 +29,7 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/pos.h" diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 2dbe93c6b2..8316d0449f 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -62,7 +62,7 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 0efd826f1d..6de6f01a52 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -48,6 +48,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" +#include "nvim/os/fs.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/fileio.h b/src/nvim/fileio.h index 318be20c91..d3a0e8c54a 100644 --- a/src/nvim/fileio.h +++ b/src/nvim/fileio.h @@ -1,12 +1,16 @@ #pragma once -#include "nvim/buffer_defs.h" +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep + +#include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" -#include "nvim/ex_cmds_defs.h" -#include "nvim/garray_defs.h" +#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep +#include "nvim/garray_defs.h" // IWYU pragma: keep #include "nvim/globals.h" -#include "nvim/os/fs_defs.h" -#include "nvim/os/os.h" +#include "nvim/os/fs_defs.h" // IWYU pragma: keep +#include "nvim/pos.h" // Values for readfile() flags #define READ_NEW 0x01 // read a file into a new buffer diff --git a/src/nvim/generators/gen_declarations.lua b/src/nvim/generators/gen_declarations.lua index 7ed0624b05..f9e9c6b0a8 100644 --- a/src/nvim/generators/gen_declarations.lua +++ b/src/nvim/generators/gen_declarations.lua @@ -171,7 +171,7 @@ static functions into static.h and declarations for non-static functions into non-static.h. File `definitions.i' should contain an already preprocessed version of definitions.c and it is the only one which is actually parsed, definitions.c is needed only to determine functions from which file out of all -functions found in definitions.i are needed. +functions found in definitions.i are needed and to generate an IWYU comment. Additionally uses the following environment variables: @@ -224,6 +224,18 @@ local non_static = header .. [[ local static = header +if fname:find('.*/src/nvim/.*%.c$') then + -- Add an IWYU pragma comment if the corresponding .h file exists. + local header_fname = fname:sub(1, -3) .. '.h' + local header_f = io.open(header_fname, 'r') + if header_f ~= nil then + header_f:close() + non_static = ([[ +// IWYU pragma: private, include "%s" +]]):format(header_fname:gsub('.*/src/nvim/', 'nvim/')) .. non_static + end +end + local filepattern = '^#%a* (%d+) "([^"]-)/?([^"/]+)"' local init = 1 @@ -241,12 +253,7 @@ while init ~= nil do curfile = file is_needed_file = (curfile == neededfile) declline = tonumber(line) - 1 - local curdir_start = dir:find('src/nvim/') - if curdir_start ~= nil then - curdir = dir:sub(curdir_start + #('src/nvim/')) - else - curdir = dir - end + curdir = dir:gsub('.*/src/nvim/', '') else declline = declline - 1 end @@ -308,7 +315,7 @@ F = io.open(static_fname, 'w') F:write(static) F:close() --- Before generating the non-static headers, check if the current file(if +-- Before generating the non-static headers, check if the current file (if -- exists) is different from the new one. If they are the same, we won't touch -- the current version to avoid triggering an unnecessary rebuilds of modules -- that depend on this one diff --git a/src/nvim/help.c b/src/nvim/help.c index 337c34f1de..b1b2feb587 100644 --- a/src/nvim/help.c +++ b/src/nvim/help.c @@ -29,6 +29,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/log.c b/src/nvim/log.c index d686621eeb..c6efdaeb49 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -23,6 +23,7 @@ #include "nvim/log.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/os/stdpaths_defs.h" #include "nvim/os/time.h" diff --git a/src/nvim/main.c b/src/nvim/main.c index b6072eb2e4..c5ab9f0cb2 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -67,6 +67,7 @@ #include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fileio.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/lang.h" #include "nvim/os/os.h" diff --git a/src/nvim/mark.c b/src/nvim/mark.c index bdd1947d73..e576253c89 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -29,6 +29,7 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c index f30eb38e99..5b64144187 100644 --- a/src/nvim/memfile.c +++ b/src/nvim/memfile.c @@ -55,7 +55,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/message.c b/src/nvim/message.c index 2ba6355528..032f079f46 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -41,6 +41,7 @@ #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index ba874422ff..deb3117f3c 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -22,6 +22,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/strings.h" diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index ed0a97aac9..b205481e98 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -19,7 +19,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/fileio.h" -#include "nvim/os/os.h" +#include "nvim/os/fs.h" #include "nvim/os/os_defs.h" #include "nvim/rbuffer.h" #include "nvim/types.h" diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 82916eca7b..b9448ddf4b 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -17,6 +17,7 @@ #endif #include "auto/config.h" +#include "nvim/os/fs.h" #if defined(HAVE_ACL) # ifdef HAVE_SYS_ACL_H @@ -39,7 +40,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option_vars.h" -#include "nvim/os/fs_defs.h" #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/types.h" diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h index 84c4e6668e..e0c970f20c 100644 --- a/src/nvim/os/os.h +++ b/src/nvim/os/os.h @@ -1,19 +1,17 @@ #pragma once -#include -#include +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep -#include "nvim/buffer_defs.h" -#include "nvim/cmdexpand_defs.h" -#include "nvim/garray_defs.h" -#include "nvim/os/fs_defs.h" +#include "nvim/buffer_defs.h" // IWYU pragma: keep +#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep +#include "nvim/garray_defs.h" // IWYU pragma: keep #include "nvim/os/os_defs.h" // IWYU pragma: export -#include "nvim/os/stdpaths_defs.h" -#include "nvim/types.h" +#include "nvim/os/stdpaths_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/env.h.generated.h" -# include "os/fs.h.generated.h" # include "os/mem.h.generated.h" # include "os/stdpaths.h.generated.h" # include "os/users.h.generated.h" diff --git a/src/nvim/os/os_win_console.c b/src/nvim/os/os_win_console.c index 44a2b6f769..784f97e58b 100644 --- a/src/nvim/os/os_win_console.c +++ b/src/nvim/os/os_win_console.c @@ -1,3 +1,4 @@ +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/os_win_console.h" diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index f3a841f7d0..d4be3086ea 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -36,7 +36,7 @@ #include "nvim/event/process.h" #include "nvim/event/stream.h" #include "nvim/log.h" -#include "nvim/os/os.h" +#include "nvim/os/fs.h" #include "nvim/os/os_defs.h" #include "nvim/os/pty_process.h" #include "nvim/os/pty_process_unix.h" diff --git a/src/nvim/path.c b/src/nvim/path.c index ad1d8771aa..805b361bb1 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -25,7 +25,7 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" diff --git a/src/nvim/profile.c b/src/nvim/profile.c index fd6c316e38..0c771d2dfe 100644 --- a/src/nvim/profile.c +++ b/src/nvim/profile.c @@ -22,6 +22,7 @@ #include "nvim/keycodes.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/pos.h" diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 68217eefe7..fdc01e0a01 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -47,7 +47,7 @@ #include "nvim/option_defs.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index decf16c02e..e6720a9211 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -40,6 +40,7 @@ #include "nvim/option.h" #include "nvim/option_defs.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/stdpaths_defs.h" diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 81b6bf2ff9..9a0d322a9a 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -41,7 +41,7 @@ #include "nvim/option.h" #include "nvim/option_vars.h" #include "nvim/os/fileio.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/path.h" diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 92bbf2aebd..0d76ad631e 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -252,6 +252,7 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" diff --git a/src/nvim/tag.c b/src/nvim/tag.c index d750e24898..90bd2f8fad 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -41,8 +41,8 @@ #include "nvim/option_defs.h" #include "nvim/option_vars.h" #include "nvim/optionstr.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" -#include "nvim/os/os.h" #include "nvim/os/os_defs.h" #include "nvim/os/time.h" #include "nvim/path.h" diff --git a/src/nvim/testing.c b/src/nvim/testing.c index d5bb5171fa..3c78a1ab0e 100644 --- a/src/nvim/testing.c +++ b/src/nvim/testing.c @@ -20,7 +20,7 @@ #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/os/os.h" +#include "nvim/os/fs.h" #include "nvim/runtime.h" #include "nvim/strings.h" #include "nvim/testing.h" diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 7cd9ae378f..15577931f3 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -110,9 +110,8 @@ #include "nvim/message.h" #include "nvim/option.h" #include "nvim/option_vars.h" -#include "nvim/os/fs_defs.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" -#include "nvim/os/os.h" #include "nvim/os/os_defs.h" #include "nvim/os/time.h" #include "nvim/path.h" diff --git a/src/nvim/window.c b/src/nvim/window.c index bed47670cc..af29a2c2d1 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -55,7 +55,7 @@ #include "nvim/option.h" #include "nvim/option_defs.h" #include "nvim/option_vars.h" -#include "nvim/os/os.h" +#include "nvim/os/fs.h" #include "nvim/os/os_defs.h" #include "nvim/path.h" #include "nvim/plines.h"