File tree Expand file tree Collapse file tree 3 files changed +41
-15
lines changed
git-function-history-gui/src Expand file tree Collapse file tree 3 files changed +41
-15
lines changed Original file line number Diff line number Diff line change @@ -119,15 +119,15 @@ impl HasFilterInformation for FunctionWithParameterRust {
119
119
}
120
120
121
121
fn description ( & self ) -> String {
122
- todo ! ( )
122
+ "Find a function with a given parameter" . to_string ( )
123
123
}
124
124
125
125
fn supports ( & self ) -> Self :: Supports {
126
126
Language ( "Rust" . to_owned ( ) )
127
127
}
128
128
129
129
fn attributes ( & self ) -> HashMap < Attribute , AttributeType > {
130
- todo ! ( )
130
+ HashMap :: from ( [ ( Attribute ( "Name" . to_string ( ) ) , AttributeType :: String ) ] )
131
131
}
132
132
133
133
type Supports = Language ;
Original file line number Diff line number Diff line change 1
1
mod types;
2
2
3
- use std:: { sync:: mpsc, time:: Duration } ;
3
+ use std:: { collections :: HashMap , sync:: mpsc, time:: Duration } ;
4
4
5
5
use eframe:: {
6
6
self ,
@@ -407,17 +407,24 @@ impl eframe::App for MyEguiApp {
407
407
ui. selectable_value (
408
408
& mut self . history_filter_type ,
409
409
HistoryFilterType :: PL (
410
- filter
411
- . 1
412
- . attributes ( )
413
- . into_iter ( )
414
- . map ( |( attr, kind) | {
415
- (
416
- attr. to_string ( ) ,
417
- kind. to_string ( ) ,
418
- )
419
- } )
420
- . collect ( ) ,
410
+ if let function_grep:: filter:: FilterType :: All ( filter) =
411
+ filter. 1
412
+ {
413
+ filter
414
+ . attributes ( )
415
+ . into_iter ( )
416
+ . map ( |( attr, kind) | {
417
+ (
418
+ attr. to_string (
419
+ ) ,
420
+ kind. to_string (
421
+ ) ,
422
+ )
423
+ } )
424
+ . collect ( )
425
+ } else {
426
+ HashMap :: new ( )
427
+ } ,
421
428
filter. 1 ,
422
429
) ,
423
430
filter. 0 ,
@@ -446,7 +453,23 @@ impl eframe::App for MyEguiApp {
446
453
ui. label ( desc. to_string ( ) ) ;
447
454
ui. add ( TextEdit :: singleline ( field) ) ;
448
455
} ) ;
449
- } )
456
+ if let function_grep:: filter:: FilterType :: Many ( _) = filters {
457
+
458
+ // TODO: update history filter type
459
+ // hashmap to keep track of if a field
460
+ // is removed
461
+ let resp = ui. add ( Button :: new ( "-" ) ) ;
462
+ if resp. clicked ( ) {
463
+ }
464
+ }
465
+ } ) ;
466
+ if let function_grep:: filter:: FilterType :: Many ( _) = filters {
467
+ let resp = ui. add ( Button :: new ( "add field" ) ) ;
468
+ if resp. clicked ( ) {
469
+ let total = inputs. len ( ) + 1 ;
470
+ inputs. insert ( format ! ( "field{total}" ) , String :: new ( ) ) ;
471
+ }
472
+ }
450
473
}
451
474
}
452
475
let resp = ui. add ( Button :: new ( "Go" ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ pub enum HistoryFilterType {
8
8
FileAbsolute ( String ) ,
9
9
FileRelative ( String ) ,
10
10
Directory ( String ) ,
11
+ // TODO: if filter type is a many and it has more than on filter
12
+ // 1. if you can pick which language to use
13
+ // 2. or you can add or remove a field to apply to the filter
11
14
PL ( HashMap < String , String > , FilterType < ' static > ) ,
12
15
None ,
13
16
}
You can’t perform that action at this time.
0 commit comments