Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/src/modules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ pub mod mods {
}

/// Types that allow for module introspection.
///
/// This API is unstable and not ready for public use.
#[doc(hidden)]
pub mod reflect {
use crate::modules::protos::yara::exts::field_options;
use std::borrow::Cow;
Expand Down Expand Up @@ -401,7 +404,7 @@ pub mod mods {
}
RuntimeType::Bool => FieldKind::Bool,
RuntimeType::String => FieldKind::String,
RuntimeType::VecU8 => FieldKind::Bytes,
RuntimeType::VecU8 => FieldKind::String,
RuntimeType::Enum(_) => FieldKind::Integer,
RuntimeType::Message(m) => {
FieldKind::Struct(Struct::new(m))
Expand Down Expand Up @@ -433,8 +436,6 @@ pub mod mods {
Bool,
/// A string.
String,
/// A bytes sequence.
Bytes,
/// A structure.
Struct(Struct),
/// An array.
Expand Down
8 changes: 4 additions & 4 deletions lib/src/modules/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,19 +371,19 @@ fn test_reflect() {

let field = fields.next().unwrap();
assert_eq!(field.name(), "bytes_foo");
assert_eq!(field.kind(), FieldKind::Bytes);
assert_eq!(field.kind(), FieldKind::String);

let field = fields.next().unwrap();
assert_eq!(field.name(), "bytes_bar");
assert_eq!(field.kind(), FieldKind::Bytes);
assert_eq!(field.kind(), FieldKind::String);

let field = fields.next().unwrap();
assert_eq!(field.name(), "bytes_raw");
assert_eq!(field.kind(), FieldKind::Bytes);
assert_eq!(field.kind(), FieldKind::String);

let field = fields.next().unwrap();
assert_eq!(field.name(), "bytes_undef");
assert_eq!(field.kind(), FieldKind::Bytes);
assert_eq!(field.kind(), FieldKind::String);

let field = fields.next().unwrap();
assert_eq!(field.name(), "enumeration");
Expand Down
1 change: 0 additions & 1 deletion ls/src/features/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ fn kind_to_string(k: &FieldKind) -> String {
FieldKind::Float => "float".to_string(),
FieldKind::Bool => "bool".to_string(),
FieldKind::String => "string".to_string(),
FieldKind::Bytes => "bytes".to_string(),
FieldKind::Struct(_) => "struct".to_string(),
FieldKind::Array(inner) => format!("array<{}>", kind_to_string(inner)),
FieldKind::Map(key, value) => {
Expand Down
2 changes: 1 addition & 1 deletion ls/src/tests/testdata/completion8.response.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
{
"label": "pdb_path",
"labelDetails": {
"description": "bytes"
"description": "string"
},
"kind": 5
},
Expand Down
Loading