emmylua_code_analysis/db_index/property/
property.rs

1use emmylua_parser::{LuaVersionCondition, VisibilityKind};
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub struct LuaCommonProperty {
5    pub id: LuaPropertyId,
6    pub description: Option<Box<String>>,
7    pub visibility: Option<VisibilityKind>,
8    pub source: Option<Box<String>>,
9    pub deprecated: Option<LuaDeprecated>,
10    pub version_conds: Option<Box<Vec<LuaVersionCondition>>>,
11    pub see_content: Option<Box<String>>,
12    pub other_content: Option<Box<String>>,
13}
14
15#[derive(Debug, Clone, PartialEq, Eq)]
16pub enum LuaDeprecated {
17    Deprecated,
18    DeprecatedWithMessage(Box<String>),
19}
20
21impl LuaCommonProperty {
22    pub fn new(id: LuaPropertyId) -> Self {
23        Self {
24            id,
25            description: None,
26            visibility: None,
27            source: None,
28            deprecated: None,
29            version_conds: None,
30            see_content: None,
31            other_content: None,
32        }
33    }
34}
35
36#[derive(Debug, Clone, Hash, PartialEq, Eq, Copy)]
37pub struct LuaPropertyId {
38    id: u32,
39}
40
41impl LuaPropertyId {
42    pub fn new(id: u32) -> Self {
43        Self { id }
44    }
45}