@@ -630,6 +630,108 @@ void f() {
630630 );
631631 }
632632
633+ Future <void > test_functionType_assignedToVariable () async {
634+ var content = '''
635+ void f(int p1, int p2) {
636+ var x = f;
637+ x(^);
638+ }
639+ ''' ;
640+ var expectedLabel = 'x(int p1, int p2)' ;
641+
642+ await _expectSignature (
643+ content,
644+ expectedLabel,
645+ expectedParams: [
646+ ParameterInformation (label: 'int p1' ),
647+ ParameterInformation (label: 'int p2' ),
648+ ],
649+ );
650+ }
651+
652+ Future <void > test_functionType_constructorTearOff () async {
653+ var content = '''
654+ class C {
655+ C(int p1, int p2) {}
656+ }
657+ void f() {
658+ var x = C.new;
659+ x(^);
660+ }
661+ ''' ;
662+ var expectedLabel = 'x(int p1, int p2)' ;
663+
664+ await _expectSignature (
665+ content,
666+ expectedLabel,
667+ expectedParams: [
668+ ParameterInformation (label: 'int p1' ),
669+ ParameterInformation (label: 'int p2' ),
670+ ],
671+ );
672+ }
673+
674+ Future <void > test_functionType_methodTearOff () async {
675+ var content = '''
676+ class C {
677+ f(int p1, int p2) {}
678+ }
679+ void f(C c) {
680+ var x = c.f;
681+ x(^);
682+ }
683+ ''' ;
684+ var expectedLabel = 'x(int p1, int p2)' ;
685+
686+ await _expectSignature (
687+ content,
688+ expectedLabel,
689+ expectedParams: [
690+ ParameterInformation (label: 'int p1' ),
691+ ParameterInformation (label: 'int p2' ),
692+ ],
693+ );
694+ }
695+
696+ Future <void > test_functionType_parameter () async {
697+ var content = '''
698+ void f(String Function(int p1, int p2) x) {
699+ x(^);
700+ }
701+ ''' ;
702+ var expectedLabel = 'x(int p1, int p2)' ;
703+
704+ await _expectSignature (
705+ content,
706+ expectedLabel,
707+ expectedParams: [
708+ ParameterInformation (label: 'int p1' ),
709+ ParameterInformation (label: 'int p2' ),
710+ ],
711+ );
712+ }
713+
714+ Future <void > test_functionType_typedef () async {
715+ var content = '''
716+ typedef Foo = String Function(int p1, int p2);
717+
718+ void f() {
719+ Foo x;
720+ x(^);
721+ }
722+ ''' ;
723+ var expectedLabel = 'x(int p1, int p2)' ;
724+
725+ await _expectSignature (
726+ content,
727+ expectedLabel,
728+ expectedParams: [
729+ ParameterInformation (label: 'int p1' ),
730+ ParameterInformation (label: 'int p2' ),
731+ ],
732+ );
733+ }
734+
633735 Future <void > test_manualTrigger_invalidLocation () async {
634736 // If the user invokes signature help, we should show it even if it's a
635737 // location where we wouldn't automatically trigger (for example in a string).
0 commit comments