Skip to content

Commit 0c31378

Browse files
committed
update
1 parent 0d73ecc commit 0c31378

6 files changed

Lines changed: 18 additions & 14 deletions

File tree

crates/emmylua_code_analysis/src/compilation/analyzer/flow/bind_analyze/comment.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use crate::{
44
compilation::analyzer::flow::{
55
binder::FlowBinder,
66
flow_node::{FlowAssertion, FlowId, FlowNodeKind},
7-
}, InFiled, LuaType, LuaVarRefId
7+
},
8+
InFiled, LuaType, LuaVarRefId,
89
};
910

1011
enum CastAction {
@@ -62,8 +63,7 @@ pub fn bind_comment(
6263
}
6364
_ => {}
6465
}
65-
}
66-
else if let Some(doc_typ) = cast_op_type.get_type() {
66+
} else if let Some(doc_typ) = cast_op_type.get_type() {
6767
let file_id = binder.file_id;
6868
let key = InFiled::new(file_id, doc_typ.get_syntax_id());
6969
let typ = match binder.context.cast_flow.get(&key) {

crates/emmylua_code_analysis/src/compilation/analyzer/flow/bind_analyze/exprs/bind_binary_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ fn bind_or_expr(binder: &mut FlowBinder, binary_expr: LuaBinaryExpr, current: Fl
227227
}
228228

229229
let Some(left_ne_flow_id) = left_ne_flow_id else {
230-
return current
230+
return current;
231231
};
232232

233233
let right_flow_id = bind_expr(binder, right, left_ne_flow_id);

crates/emmylua_code_analysis/src/compilation/analyzer/flow/bind_analyze/stats.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use emmylua_parser::{
2-
LuaAssignStat, LuaAst, LuaAstNode, LuaBreakStat, LuaCallExprStat, LuaDoStat, LuaForRangeStat, LuaFuncStat, LuaGotoStat, LuaIfStat, LuaLabelStat, LuaLocalStat, LuaRepeatStat, LuaReturnStat, LuaVarExpr, LuaWhileStat, PathTrait
2+
LuaAssignStat, LuaAst, LuaAstNode, LuaBreakStat, LuaCallExprStat, LuaDoStat, LuaForRangeStat,
3+
LuaFuncStat, LuaGotoStat, LuaIfStat, LuaLabelStat, LuaLocalStat, LuaRepeatStat, LuaReturnStat,
4+
LuaVarExpr, LuaWhileStat, PathTrait,
35
};
46

57
use crate::{
@@ -219,7 +221,11 @@ pub fn bind_while_stat(
219221
current
220222
}
221223

222-
pub fn bind_repeat_stat(binder: &mut FlowBinder, repeat_stat: LuaRepeatStat, current: FlowId) -> FlowId {
224+
pub fn bind_repeat_stat(
225+
binder: &mut FlowBinder,
226+
repeat_stat: LuaRepeatStat,
227+
current: FlowId,
228+
) -> FlowId {
223229
let old_loop_label = binder.loop_label;
224230

225231
// Create a loop label for the repeat statement
@@ -306,11 +312,7 @@ pub fn bind_if_stat(binder: &mut FlowBinder, if_stat: LuaIfStat, current: FlowId
306312
current
307313
}
308314

309-
pub fn bind_func_stat(
310-
binder: &mut FlowBinder,
311-
func_stat: LuaFuncStat,
312-
current: FlowId,
313-
) -> FlowId {
315+
pub fn bind_func_stat(binder: &mut FlowBinder, func_stat: LuaFuncStat, current: FlowId) -> FlowId {
314316
bind_each_child(binder, LuaAst::LuaFuncStat(func_stat), current);
315317
current
316318
}

crates/emmylua_code_analysis/src/db_index/flow/flow_chain.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ impl LuaClosureId {
5656

5757
pub fn from_node(node: &LuaSyntaxNode) -> Self {
5858
let flow_id = node.ancestors().find_map(|node| match node.kind().into() {
59-
LuaSyntaxKind::ClosureExpr => LuaClosureExpr::cast(node).map(LuaClosureId::from_closure),
59+
LuaSyntaxKind::ClosureExpr => {
60+
LuaClosureExpr::cast(node).map(LuaClosureId::from_closure)
61+
}
6062
LuaSyntaxKind::Chunk => LuaChunk::cast(node).map(LuaClosureId::from_chunk),
6163
_ => None,
6264
});

crates/emmylua_code_analysis/src/db_index/flow/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod type_assert;
44

55
use std::collections::HashMap;
66

7-
pub use flow_chain::{LuaFlowChain, LuaFlowChainInfo, LuaClosureId};
7+
pub use flow_chain::{LuaClosureId, LuaFlowChain, LuaFlowChainInfo};
88
pub use flow_var_ref_id::{LuaVarRefId, LuaVarRefNode};
99
pub use type_assert::TypeAssertion;
1010

crates/emmylua_code_analysis/src/semantic/infer/infer_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use smol_str::SmolStr;
33

44
use crate::{
55
db_index::{DbIndex, LuaDeclOrMemberId},
6-
LuaDecl, LuaDeclExtra, LuaClosureId, LuaInferCache, LuaMemberId, LuaType, LuaVarRefId, TypeOps,
6+
LuaClosureId, LuaDecl, LuaDeclExtra, LuaInferCache, LuaMemberId, LuaType, LuaVarRefId, TypeOps,
77
};
88

99
use super::{InferFailReason, InferResult};

0 commit comments

Comments
 (0)