@@ -216,7 +216,6 @@ fn get_hover_strategy(source: &str, file_info: &FileInfo, offset: u32) -> Option
216216 let mut schema = schema;
217217 for attr in attrpath. attrs ( ) . take ( index + 1 ) {
218218 schema = schema. attr_subschema ( & attr) . clone ( ) ;
219- eprintln ! ( "subschema {:?}" , schema) ;
220219 }
221220
222221 Some ( HoverStrategy {
@@ -528,4 +527,44 @@ mod test {
528527 )
529528 . await ;
530529 }
530+
531+ #[ test_log:: test( tokio:: test) ]
532+ async fn test_hover_lambda ( ) {
533+ check_hover_with_filetype (
534+ r#"{ pkgs }: { programs.zsh.enableAutosug$0gestions = false; }"# ,
535+ expect ! [ [ r#"
536+ no position
537+
538+ ### option `programs.zsh.enableAutosuggestions`
539+ Alias of {option}`programs.zsh.autosuggestion.enable`.
540+
541+ *Type:* boolean
542+ "# ] ] ,
543+ & FileType :: Package {
544+ nixpkgs_path : env ! ( "NIXPKGS" ) . to_string ( ) ,
545+ schema : HOME_MANAGER_SCHEMA . clone ( ) ,
546+ } ,
547+ )
548+ . await ;
549+ }
550+
551+ #[ test_log:: test( tokio:: test) ]
552+ async fn test_hover_lambda_let ( ) {
553+ check_hover_with_filetype (
554+ r#"{ pkgs }: let four = 2+2; in { programs.zsh.enableAutosug$0gestions = false; }"# ,
555+ expect ! [ [ r#"
556+ no position
557+
558+ ### option `programs.zsh.enableAutosuggestions`
559+ Alias of {option}`programs.zsh.autosuggestion.enable`.
560+
561+ *Type:* boolean
562+ "# ] ] ,
563+ & FileType :: Package {
564+ nixpkgs_path : env ! ( "NIXPKGS" ) . to_string ( ) ,
565+ schema : HOME_MANAGER_SCHEMA . clone ( ) ,
566+ } ,
567+ )
568+ . await ;
569+ }
531570}
0 commit comments