refactor: IWYU (#27186)

This commit is contained in:
zeertzjq
2024-01-25 07:57:21 +08:00
committed by GitHub
parent 76a659eb77
commit 4e59422e1d
20 changed files with 31 additions and 17 deletions

View File

@@ -32,7 +32,7 @@
#include "nvim/mapping.h" #include "nvim/mapping.h"
#include "nvim/mark.h" #include "nvim/mark.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memline_defs.h" #include "nvim/memline_defs.h"
#include "nvim/memory.h" #include "nvim/memory.h"

View File

@@ -1,11 +1,14 @@
#pragma once #pragma once
#include <stdint.h>
#include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" #include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep #include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h" #include "nvim/func_attr.h"
#include "nvim/gettext_defs.h" // IWYU pragma: keep #include "nvim/gettext_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/marktree_defs.h"
#include "nvim/types_defs.h" #include "nvim/types_defs.h"
/// Values for buflist_getfile() /// Values for buflist_getfile()

View File

@@ -33,7 +33,7 @@
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/mark.h" #include "nvim/mark.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h" #include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"

View File

@@ -13,6 +13,7 @@
#include "nvim/globals.h" #include "nvim/globals.h"
#include "nvim/mark.h" #include "nvim/mark.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/move.h" #include "nvim/move.h"

View File

@@ -18,7 +18,6 @@
#include "nvim/grid_defs.h" #include "nvim/grid_defs.h"
#include "nvim/highlight.h" #include "nvim/highlight.h"
#include "nvim/highlight_group.h" #include "nvim/highlight_group.h"
#include "nvim/map_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/move.h" #include "nvim/move.h"
@@ -673,8 +672,8 @@ int sign_item_cmp(const void *p1, const void *p2)
? n : (s2->sh->sign_add_id - s1->sh->sign_add_id); ? n : (s2->sh->sign_add_id - s1->sh->sign_add_id);
} }
const uint32_t sign_filter[4] = {[kMTMetaSignText] = kMTFilterSelect, static const uint32_t sign_filter[4] = {[kMTMetaSignText] = kMTFilterSelect,
[kMTMetaSignHL] = kMTFilterSelect }; [kMTMetaSignHL] = kMTFilterSelect };
/// Return the sign attributes on the currently refreshed row. /// Return the sign attributes on the currently refreshed row.
/// ///
@@ -761,7 +760,7 @@ DecorSignHighlight *decor_find_sign(DecorInline decor)
} }
} }
const uint32_t signtext_filter[4] = {[kMTMetaSignText] = kMTFilterSelect }; static const uint32_t signtext_filter[4] = {[kMTMetaSignText] = kMTFilterSelect };
/// Count the number of signs in a range after adding/removing a sign, or to /// Count the number of signs in a range after adding/removing a sign, or to
/// (re-)initialize a range in "b_signcols.count". /// (re-)initialize a range in "b_signcols.count".
@@ -861,7 +860,7 @@ bool decor_redraw_eol(win_T *wp, DecorState *state, int *eol_attr, int eol_col)
return has_virt_pos; return has_virt_pos;
} }
uint32_t lines_filter[4] = {[kMTMetaLines] = kMTFilterSelect }; static const uint32_t lines_filter[4] = {[kMTMetaLines] = kMTFilterSelect };
/// @param has_fold whether line "lnum" has a fold, or kNone when not calculated yet /// @param has_fold whether line "lnum" has a fold, or kNone when not calculated yet
int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines, TriState has_fold) int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines, TriState has_fold)

View File

@@ -32,9 +32,10 @@
#include "nvim/highlight_group.h" #include "nvim/highlight_group.h"
#include "nvim/indent.h" #include "nvim/indent.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree_defs.h"
#include "nvim/match.h" #include "nvim/match.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/move.h" #include "nvim/move.h"

View File

@@ -88,7 +88,7 @@
#include "nvim/highlight_defs.h" #include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h" #include "nvim/highlight_group.h"
#include "nvim/insexpand.h" #include "nvim/insexpand.h"
#include "nvim/marktree.h" #include "nvim/marktree_defs.h"
#include "nvim/match.h" #include "nvim/match.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/memline.h" #include "nvim/memline.h"

View File

@@ -41,7 +41,7 @@
#include "nvim/mapping.h" #include "nvim/mapping.h"
#include "nvim/mark.h" #include "nvim/mark.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h" #include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"

View File

@@ -39,6 +39,7 @@
#include "nvim/map_defs.h" #include "nvim/map_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/pos_defs.h" #include "nvim/pos_defs.h"
#include "nvim/types_defs.h" #include "nvim/types_defs.h"
#include "nvim/undo.h" #include "nvim/undo.h"

View File

@@ -22,7 +22,6 @@
#include "nvim/globals.h" #include "nvim/globals.h"
#include "nvim/grid.h" #include "nvim/grid.h"
#include "nvim/highlight.h" #include "nvim/highlight.h"
#include "nvim/highlight_defs.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/map_defs.h" #include "nvim/map_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"

View File

@@ -25,6 +25,7 @@
#include "nvim/indent_c.h" #include "nvim/indent_c.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/message.h" #include "nvim/message.h"

View File

@@ -1,11 +1,13 @@
#pragma once #pragma once
#include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> // IWYU pragma: keep #include <sys/types.h> // IWYU pragma: keep
#include <uv.h> // IWYU pragma: keep #include <uv.h> // IWYU pragma: keep
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/mbyte_defs.h" // IWYU pragma: keep #include "nvim/mbyte_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep #include "nvim/types_defs.h" // IWYU pragma: keep

View File

@@ -2,7 +2,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> // IWYU pragma: keep #include <stdint.h> // IWYU pragma: keep
#include <string.h>
#include <time.h> // IWYU pragma: keep #include <time.h> // IWYU pragma: keep
#include "auto/config.h" #include "auto/config.h"

View File

@@ -23,6 +23,7 @@
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/menu.h" #include "nvim/menu.h"

View File

@@ -46,6 +46,7 @@
#include "nvim/mark.h" #include "nvim/mark.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memline_defs.h" #include "nvim/memline_defs.h"
#include "nvim/memory.h" #include "nvim/memory.h"

View File

@@ -19,6 +19,7 @@
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/move.h" #include "nvim/move.h"
#include "nvim/option.h" #include "nvim/option.h"
@@ -76,7 +77,8 @@ int linetabsize(win_T *wp, linenr_T lnum)
return win_linetabsize(wp, lnum, ml_get_buf(wp->w_buffer, lnum), (colnr_T)MAXCOL); return win_linetabsize(wp, lnum, ml_get_buf(wp->w_buffer, lnum), (colnr_T)MAXCOL);
} }
const uint32_t inline_filter[4] = {[kMTMetaInline] = kMTFilterSelect }; static const uint32_t inline_filter[4] = {[kMTMetaInline] = kMTFilterSelect };
/// Prepare the structure passed to charsize functions. /// Prepare the structure passed to charsize functions.
/// ///
/// "line" is the start of the line. /// "line" is the start of the line.

View File

@@ -1,11 +1,11 @@
#pragma once #pragma once
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> // IWYU pragma: keep #include <stdint.h>
#include "nvim/func_attr.h"
#include "nvim/marktree_defs.h" #include "nvim/marktree_defs.h"
#include "nvim/mbyte_defs.h" #include "nvim/pos_defs.h"
#include "nvim/pos_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" #include "nvim/types_defs.h"
typedef bool CSType; typedef bool CSType;

View File

@@ -3,6 +3,7 @@
#include <assert.h> #include <assert.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -26,6 +27,7 @@
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/main.h" #include "nvim/main.h"
#include "nvim/map_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/msgpack_rpc/channel.h" #include "nvim/msgpack_rpc/channel.h"

View File

@@ -4,6 +4,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <uv.h>
#include "klib/kvec.h" #include "klib/kvec.h"
#include "nvim/api/private/helpers.h" #include "nvim/api/private/helpers.h"
@@ -31,6 +32,7 @@
#include "nvim/option.h" #include "nvim/option.h"
#include "nvim/option_defs.h" #include "nvim/option_defs.h"
#include "nvim/option_vars.h" #include "nvim/option_vars.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/state_defs.h" #include "nvim/state_defs.h"
#include "nvim/strings.h" #include "nvim/strings.h"

View File

@@ -67,7 +67,6 @@
// Uncomment the next line for including the u_check() function. This warns // Uncomment the next line for including the u_check() function. This warns
// for errors in the debug information. // for errors in the debug information.
// #define U_DEBUG 1 // #define U_DEBUG 1
#include "nvim/marktree.h"
#define UH_MAGIC 0x18dade // value for uh_magic when in use #define UH_MAGIC 0x18dade // value for uh_magic when in use
#define UE_MAGIC 0xabc123 // value for ue_magic when in use #define UE_MAGIC 0xabc123 // value for ue_magic when in use
@@ -112,6 +111,7 @@
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/mark.h" #include "nvim/mark.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/marktree_defs.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memline_defs.h" #include "nvim/memline_defs.h"