dte test coverage


Directory: ./
File: src/completion.h
Date: 2024-12-21 16:03:22
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 "editor.h"
6 #include "util/hashmap.h"
7 #include "util/macros.h"
8 #include "util/ptr-array.h"
9
10 void complete_command_next(EditorState *e) NONNULL_ARGS;
11 void complete_command_prev(EditorState *e) NONNULL_ARGS;
12 void reset_completion(CommandLine *cmdline) NONNULL_ARGS;
13
14 // Like reset_completion(), but for use in contexts where there's
15 // nothing to reset most of the time
16 22 static inline void maybe_reset_completion(CommandLine *cmdline)
17 {
18 22 CompletionState *cs = &cmdline->completion;
19
2/2
✓ Branch 0 taken 21 times.
✓ Branch 1 taken 1 times.
22 if (likely(!cs->orig)) {
20 21 BUG_ON(cs->parsed);
21 21 BUG_ON(cs->completions.alloc != 0);
22 return;
23 }
24 1 reset_completion(cmdline);
25 }
26
27 void collect_env(EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
28 void collect_normal_aliases(EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
29 void collect_bound_normal_keys(EditorState *e, PointerArray *a, const char *keystr_prefix) NONNULL_ARGS;
30 void collect_hl_styles(EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
31 void collect_compilers(EditorState *e, PointerArray *a, const char *prefix) NONNULL_ARGS;
32 void collect_hashmap_keys(const HashMap *map, PointerArray *a, const char *prefix) NONNULL_ARGS;
33
34 #endif
35