nvim_api/types/
command_complete.rs

1use nvim_types::{
2    conversion::{self, ToObject},
3    serde::Serializer,
4    Function,
5    Object,
6};
7use serde::Serialize;
8
9/// See `:h command-complete` for details.
10#[non_exhaustive]
11#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize)]
12#[serde(rename_all = "snake_case")]
13pub enum CommandComplete {
14    Arglist,
15    Augroup,
16    Buffer,
17    Behave,
18    Color,
19    Command,
20    Compiler,
21    Cscope,
22    Dir,
23    Environment,
24    Event,
25    Expression,
26    File,
27    FileInPath,
28    Filetype,
29    Function,
30    Help,
31    Highlight,
32    History,
33    Locale,
34    Lua,
35    Mapclear,
36    Mapping,
37    Menu,
38    Messages,
39    Option,
40    Packadd,
41    Shellcmd,
42    Sign,
43    Syntax,
44    Syntime,
45    Tag,
46    TagListfiles,
47    User,
48    Var,
49
50    /// See `:h command-completion-customlist` for details.
51    CustomList(Function<(String, String, usize), Vec<String>>),
52}
53
54impl ToObject for CommandComplete {
55    fn to_object(self) -> Result<Object, conversion::Error> {
56        self.serialize(Serializer::new()).map_err(Into::into)
57    }
58}