autocomplete fully works now

This commit is contained in:
Simon Gardling
2022-03-31 09:46:01 -04:00
parent e44823713b
commit 68b4eb9454
6 changed files with 110 additions and 33 deletions

View File

@@ -72,9 +72,38 @@ impl HintEnum<'static> {
_ => false,
}
}
pub fn ensure_many(&self) -> &[&str] {
match self {
HintEnum::Many(data) => data,
_ => panic!("ensure_many called on non-Many value"),
}
}
pub fn is_some(&self) -> bool {
match self {
HintEnum::None => false,
_ => true,
}
}
pub fn is_none(&self) -> bool { !self.is_some() }
#[allow(dead_code)]
pub fn ensure_single(&self) -> &&str {
match self {
HintEnum::Single(data) => data,
_ => panic!("ensure_single called on non-Single value"),
}
}
#[allow(dead_code)]
pub fn is_single(&self) -> bool { !self.is_multi() }
}
// include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
/// Generated by build.rs
/// Manually put here so build.rs doesn't have to recalculate every time
static COMPLETION_HASHMAP: phf::Map<&'static str, HintEnum> = ::phf::Map {
key: 2980949210194914378,
disps: &[