@@ -29,6 +29,27 @@ pub struct Config {
2929 #[ serde( default ) ]
3030 pub review_instructions : Option < String > ,
3131
32+ #[ serde( default = "default_true" ) ]
33+ pub smart_review_summary : bool ,
34+
35+ #[ serde( default ) ]
36+ pub smart_review_diagram : bool ,
37+
38+ #[ serde( default = "default_true" ) ]
39+ pub symbol_index : bool ,
40+
41+ #[ serde( default = "default_symbol_index_max_files" ) ]
42+ pub symbol_index_max_files : usize ,
43+
44+ #[ serde( default = "default_symbol_index_max_bytes" ) ]
45+ pub symbol_index_max_bytes : usize ,
46+
47+ #[ serde( default = "default_symbol_index_max_locations" ) ]
48+ pub symbol_index_max_locations : usize ,
49+
50+ #[ serde( default = "default_feedback_path" ) ]
51+ pub feedback_path : PathBuf ,
52+
3253 pub system_prompt : Option < String > ,
3354 pub api_key : Option < String > ,
3455 pub base_url : Option < String > ,
@@ -101,6 +122,13 @@ impl Default for Config {
101122 min_confidence : default_min_confidence ( ) ,
102123 review_profile : None ,
103124 review_instructions : None ,
125+ smart_review_summary : true ,
126+ smart_review_diagram : false ,
127+ symbol_index : true ,
128+ symbol_index_max_files : default_symbol_index_max_files ( ) ,
129+ symbol_index_max_bytes : default_symbol_index_max_bytes ( ) ,
130+ symbol_index_max_locations : default_symbol_index_max_locations ( ) ,
131+ feedback_path : default_feedback_path ( ) ,
104132 system_prompt : None ,
105133 api_key : None ,
106134 base_url : None ,
@@ -166,6 +194,16 @@ impl Config {
166194 self . max_tokens = default_max_tokens ( ) ;
167195 }
168196
197+ if self . symbol_index_max_files == 0 {
198+ self . symbol_index_max_files = default_symbol_index_max_files ( ) ;
199+ }
200+ if self . symbol_index_max_bytes == 0 {
201+ self . symbol_index_max_bytes = default_symbol_index_max_bytes ( ) ;
202+ }
203+ if self . symbol_index_max_locations == 0 {
204+ self . symbol_index_max_locations = default_symbol_index_max_locations ( ) ;
205+ }
206+
169207 if !self . min_confidence . is_finite ( ) {
170208 self . min_confidence = default_min_confidence ( ) ;
171209 } else if !( 0.0 ..=1.0 ) . contains ( & self . min_confidence ) {
@@ -292,6 +330,22 @@ fn default_min_confidence() -> f32 {
292330 0.0
293331}
294332
333+ fn default_symbol_index_max_files ( ) -> usize {
334+ 500
335+ }
336+
337+ fn default_symbol_index_max_bytes ( ) -> usize {
338+ 200_000
339+ }
340+
341+ fn default_symbol_index_max_locations ( ) -> usize {
342+ 5
343+ }
344+
345+ fn default_feedback_path ( ) -> PathBuf {
346+ PathBuf :: from ( ".diffscope.feedback.json" )
347+ }
348+
295349fn default_true ( ) -> bool {
296350 true
297351}
0 commit comments