Skip to content

Commit 9c64ceb

Browse files
committed
reformat repo
1 parent b66dc4e commit 9c64ceb

File tree

162 files changed

+697
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+697
-661
lines changed

crates/emmylua_check/src/cmd_args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ impl OutputFormat {
6262
}
6363
}
6464

65-
6665
#[allow(unused)]
6766
#[derive(Debug, Clone)]
6867
pub enum OutputDestination {
@@ -78,4 +77,4 @@ impl std::str::FromStr for OutputDestination {
7877
_ => Ok(OutputDestination::File(std::path::PathBuf::from(s))),
7978
}
8079
}
81-
}
80+
}

crates/emmylua_check/src/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{path::PathBuf, sync::Arc, str::FromStr};
1+
use std::{path::PathBuf, str::FromStr, sync::Arc};
22

33
use emmylua_code_analysis::{
44
load_configs, load_workspace_files, update_code_style, EmmyLuaAnalysis, Emmyrc, LuaFileInfo,

crates/emmylua_code_analysis/src/compilation/analyzer/decl/docs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ pub fn analyze_doc_tag_meta(analyzer: &mut DeclAnalyzer, tag: LuaDocTagMeta) ->
157157
analyzer
158158
.db
159159
.get_module_index_mut()
160-
.add_module_by_module_path(file_id, name_token.get_name_text().to_string(), workspace_id);
160+
.add_module_by_module_path(
161+
file_id,
162+
name_token.get_name_text().to_string(),
163+
workspace_id,
164+
);
161165
}
162166
}
163167

crates/emmylua_code_analysis/src/compilation/analyzer/decl/stats.rs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use emmylua_parser::{
2-
LuaAssignStat, LuaAstNode, LuaAstToken, LuaExpr, LuaForRangeStat, LuaForStat, LuaFuncStat, LuaIndexExpr, LuaLocalFuncStat, LuaLocalStat, LuaSyntaxId, LuaSyntaxKind, LuaVarExpr
2+
LuaAssignStat, LuaAstNode, LuaAstToken, LuaExpr, LuaForRangeStat, LuaForStat, LuaFuncStat,
3+
LuaIndexExpr, LuaLocalFuncStat, LuaLocalStat, LuaSyntaxId, LuaSyntaxKind, LuaVarExpr,
34
};
45

56
use crate::{
@@ -10,9 +11,9 @@ use crate::{
1011
use super::DeclAnalyzer;
1112

1213
pub fn analyze_local_stat(analyzer: &mut DeclAnalyzer, stat: LuaLocalStat) -> Option<()> {
13-
let local_name_list= stat.get_local_name_list().collect::<Vec<_>>();
14+
let local_name_list = stat.get_local_name_list().collect::<Vec<_>>();
1415
let value_expr_list = stat.get_value_exprs().collect::<Vec<_>>();
15-
16+
1617
for (index, local_name) in local_name_list.iter().enumerate() {
1718
let name = if let Some(name_token) = local_name.get_name_token() {
1819
name_token.get_name_text().to_string()
@@ -48,7 +49,7 @@ pub fn analyze_local_stat(analyzer: &mut DeclAnalyzer, stat: LuaLocalStat) -> Op
4849
attrib,
4950
decl_type: None,
5051
},
51-
expr_id
52+
expr_id,
5253
);
5354
analyzer.add_decl(decl);
5455
}
@@ -87,7 +88,7 @@ pub fn analyze_assign_stat(analyzer: &mut DeclAnalyzer, stat: LuaAssignStat) ->
8788
kind: LuaSyntaxKind::NameExpr.into(),
8889
decl_type: None,
8990
},
90-
value_expr_id
91+
value_expr_id,
9192
);
9293

9394
analyzer.add_decl(decl);
@@ -111,7 +112,13 @@ pub fn analyze_assign_stat(analyzer: &mut DeclAnalyzer, stat: LuaAssignStat) ->
111112

112113
analyzer.db.get_member_index_mut().add_member(member);
113114
if let LuaMemberKey::Name(name) = &key {
114-
analyze_maybe_global_index_expr(analyzer, index_expr, &name, None, value_expr_id);
115+
analyze_maybe_global_index_expr(
116+
analyzer,
117+
index_expr,
118+
&name,
119+
None,
120+
value_expr_id,
121+
);
115122
}
116123
}
117124
}
@@ -125,7 +132,7 @@ fn analyze_maybe_global_index_expr(
125132
index_expr: &LuaIndexExpr,
126133
index_name: &str,
127134
typ: Option<LuaType>,
128-
value_expr_id: Option<LuaSyntaxId>
135+
value_expr_id: Option<LuaSyntaxId>,
129136
) -> Option<()> {
130137
let file_id = analyzer.get_file_id();
131138
let prefix = index_expr.get_prefix_expr()?;
@@ -151,7 +158,7 @@ fn analyze_maybe_global_index_expr(
151158
kind: LuaSyntaxKind::IndexExpr.into(),
152159
decl_type: typ,
153160
},
154-
value_expr_id
161+
value_expr_id,
155162
);
156163

157164
analyzer.add_decl(decl);
@@ -203,7 +210,7 @@ pub fn analyze_for_range_stat(analyzer: &mut DeclAnalyzer, stat: LuaForRangeStat
203210
attrib: Some(LocalAttribute::IterConst),
204211
decl_type: None,
205212
},
206-
None
213+
None,
207214
);
208215

209216
analyzer.add_decl(decl);
@@ -228,7 +235,7 @@ pub fn analyze_func_stat(analyzer: &mut DeclAnalyzer, stat: LuaFuncStat) -> Opti
228235
kind: LuaSyntaxKind::NameExpr.into(),
229236
decl_type: None,
230237
},
231-
None
238+
None,
232239
);
233240

234241
let decl_id = analyzer.add_decl(decl);
@@ -264,7 +271,8 @@ pub fn analyze_func_stat(analyzer: &mut DeclAnalyzer, stat: LuaFuncStat) -> Opti
264271

265272
let closure = stat.get_closure()?;
266273
let file_id = analyzer.get_file_id();
267-
let closure_owner_id = LuaPropertyOwnerId::Signature(LuaSignatureId::from_closure(file_id, &closure));
274+
let closure_owner_id =
275+
LuaPropertyOwnerId::Signature(LuaSignatureId::from_closure(file_id, &closure));
268276
analyzer.db.get_property_index_mut().add_owner_map(
269277
property_owner_id,
270278
closure_owner_id,
@@ -289,12 +297,13 @@ pub fn analyze_local_func_stat(analyzer: &mut DeclAnalyzer, stat: LuaLocalFuncSt
289297
attrib: None,
290298
decl_type: None,
291299
},
292-
None
300+
None,
293301
);
294302

295303
let decl_id = analyzer.add_decl(decl);
296304
let closure = stat.get_closure()?;
297-
let closure_owner_id = LuaPropertyOwnerId::Signature(LuaSignatureId::from_closure(file_id, &closure));
305+
let closure_owner_id =
306+
LuaPropertyOwnerId::Signature(LuaSignatureId::from_closure(file_id, &closure));
298307
let property_decl_id = LuaPropertyOwnerId::LuaDecl(decl_id);
299308
analyzer
300309
.db

crates/emmylua_code_analysis/src/compilation/analyzer/doc/diagnostic_tags.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ fn analyze_diagnostic_disable_line(
124124
Some(())
125125
}
126126

127-
128127
fn analyze_diagnostic_enable(
129128
analyzer: &mut DocAnalyzer,
130129
diagnostic: LuaDocTagDiagnostic,

crates/emmylua_code_analysis/src/compilation/analyzer/doc/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ fn analyze_comment(analyzer: &mut DocAnalyzer) -> Option<()> {
4343
}
4444

4545
let owenr = get_owner_id(analyzer)?;
46-
let comment_description = preprocess_description(&comment.get_description()?.get_description_text());
46+
let comment_description =
47+
preprocess_description(&comment.get_description()?.get_description_text());
4748
analyzer.db.get_property_index_mut().add_description(
4849
analyzer.file_id,
4950
owenr,

crates/emmylua_code_analysis/src/compilation/analyzer/doc/property_tags.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use crate::{LuaPropertyOwnerId, LuaSignatureId};
22

3-
use super::{tags::{find_owner_closure, get_owner_id}, DocAnalyzer};
3+
use super::{
4+
tags::{find_owner_closure, get_owner_id},
5+
DocAnalyzer,
6+
};
47
use emmylua_parser::{
58
LuaDocDescriptionOwner, LuaDocTagDeprecated, LuaDocTagSource, LuaDocTagVersion,
69
LuaDocTagVisibility,

crates/emmylua_code_analysis/src/compilation/analyzer/doc/type_ref_tags.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use crate::{
99
db_index::{
1010
LuaDeclId, LuaDocParamInfo, LuaDocReturnInfo, LuaMemberId, LuaOperator, LuaPropertyOwnerId,
1111
LuaSignatureId, LuaType,
12-
}, InFiled, LuaFlowId, SignatureReturnStatus, TypeAssertion
12+
},
13+
InFiled, LuaFlowId, SignatureReturnStatus, TypeAssertion,
1314
};
1415

1516
use super::{

crates/emmylua_code_analysis/src/compilation/analyzer/flow/flow_builder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::collections::HashMap;
21
use crate::LuaFlowId;
2+
use std::collections::HashMap;
33

4-
use super::flow_nodes::{FlowNodes, FlowNode};
4+
use super::flow_nodes::{FlowNode, FlowNodes};
55

66
#[derive(Debug)]
77
pub struct FlowBuilder {
@@ -12,7 +12,6 @@ pub struct FlowBuilder {
1212

1313
impl FlowBuilder {
1414
pub fn new() -> FlowBuilder {
15-
1615
let mut builder = FlowBuilder {
1716
current_flow_id: LuaFlowId::chunk(),
1817
flow_id_stack: Vec::new(),

crates/emmylua_code_analysis/src/compilation/analyzer/lua/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ use stats::{
1313
};
1414

1515
use crate::{
16-
db_index::{DbIndex, LuaType}, profile::Profile, semantic::{infer_expr, LuaInferConfig}, FileId
16+
db_index::{DbIndex, LuaType},
17+
profile::Profile,
18+
semantic::{infer_expr, LuaInferConfig},
19+
FileId,
1720
};
1821

1922
use super::{unresolve::UnResolve, AnalyzeContext};

0 commit comments

Comments
 (0)