dte test coverage


Directory: ./
File: src/completion.h
Date: 2025-09-07 23:01:39
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 1 1 100.0%
Branches: 2 2 100.0%

Line Branch Exec Source
1 #ifndef COMPLETION_H
2 #define COMPLETION_H
3
4 #include "cmdline.h"
5 #include "util/debug.h"
6 #include "util/hashmap.h"
7 #include "util/macros.h"
8 #include "util/ptr-array.h"
9 #include "util/string-view.h"
10
11 struct EditorState;
12
13 void complete_command_next(struct EditorState *e) NONNULL_ARGS;
14 void complete_command_prev(struct EditorState *e) NONNULL_ARGS;
15 void reset_completion(CommandLine *cmdline) NONNULL_ARGS;
16
17 // Like reset_completion(), but for use in contexts where there's
18 // nothing to reset most of the time
19 23 static inline void maybe_reset_completion(CommandLine *cmdline)
20 {
21 23 CompletionState *cs = &cmdline->completion;
22
2/2
✓ Branch 0 (2→3) taken 22 times.
✓ Branch 1 (2→7) taken 1 times.
23 if (likely(!cs->orig)) {
23 22 BUG_ON(cs->parsed);
24 22 BUG_ON(cs->completions.alloc != 0);
25 return;
26 }
27 1 reset_completion(cmdline);
28 }
29
30 void collect_env(char **env, PointerArray *a, StringView prefix, const char *suffix) NONNULL_ARGS;
31 void collect_normal_aliases(struct EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
32 void collect_bound_normal_keys(struct EditorState *e, PointerArray *a, const char *keystr_prefix) NONNULL_ARGS;
33 void collect_hl_styles(struct EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
34 void collect_compilers(struct EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
35 void collect_hashmap_keys(const HashMap *map, PointerArray *a, const char *prefix) NONNULL_ARGS;
36
37 #endif
38