Skip to content

Commit f5bdedf

Browse files
committed
add cmd args
1 parent 273f997 commit f5bdedf

File tree

12 files changed

+364
-50
lines changed

12 files changed

+364
-50
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
},
2222
"args": [
23-
"5007"
23+
"--port", "5007"
2424
],
2525
"cwd": "${workspaceFolder}"
2626
},

Cargo.lock

Lines changed: 180 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ walkdir = "2.5.0"
2222
serde_yml = "0.0.12"
2323
dirs = "5"
2424
emmylua_codestyle = "0.2.0"
25+
structopt = "0.3"

crates/code_analysis/src/db_index/property/property.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
use emmylua_parser::{LuaVersionCondition, VisibilityKind};
22
use serde::{Deserialize, Serialize};
33

4-
use crate::db_index::{member::LuaMemberId, LuaDeclId, LuaSignatureId, LuaTypeDeclId};
4+
use crate::{
5+
db_index::{member::LuaMemberId, LuaDeclId, LuaSignatureId, LuaTypeDeclId},
6+
FileId,
7+
};
58

69
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
710
pub struct LuaProperty {
@@ -74,3 +77,14 @@ impl From<LuaSignatureId> for LuaPropertyOwnerId {
7477
LuaPropertyOwnerId::Signature(id)
7578
}
7679
}
80+
81+
impl LuaPropertyOwnerId {
82+
pub fn get_file_id(&self) -> Option<FileId> {
83+
match self {
84+
LuaPropertyOwnerId::TypeDecl(_) => None,
85+
LuaPropertyOwnerId::Member(id) => Some(id.file_id),
86+
LuaPropertyOwnerId::LuaDecl(id) => Some(id.file_id),
87+
LuaPropertyOwnerId::Signature(id) => Some(id.get_file_id()),
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)