Version 2.14.0-152.0.dev
Merge commit '3cf34d172f8de4b87a5efd9c136fe882161963e1' into 'dev'
diff --git a/pkg/analysis_server/lib/src/computer/computer_signature.dart b/pkg/analysis_server/lib/src/computer/computer_signature.dart
index 55ce1a9..04fdea1 100644
--- a/pkg/analysis_server/lib/src/computer/computer_signature.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_signature.dart
@@ -48,7 +48,7 @@
if (constructorName != null) {
name += '.${constructorName.name}';
}
- execElement = ElementLocator.locate(parent) as ExecutableElement;
+ execElement = ElementLocator.locate(parent) as ExecutableElement?;
}
if (name == null || execElement == null) {
diff --git a/pkg/analysis_server/test/lsp/signature_help_test.dart b/pkg/analysis_server/test/lsp/signature_help_test.dart
index 31e1ff3..dacaefe 100644
--- a/pkg/analysis_server/test/lsp/signature_help_test.dart
+++ b/pkg/analysis_server/test/lsp/signature_help_test.dart
@@ -16,6 +16,12 @@
}
mixin SignatureHelpMixin on AbstractLspAnalysisServerTest {
+ Future<void> expectNoSignature(String fileContent) async {
+ final res =
+ await getSignatureHelp(mainFileUri, positionFromMarker(fileContent));
+ expect(res, isNull);
+ }
+
Future<void> testSignature(
String fileContent,
String expectedLabel,
@@ -247,6 +253,22 @@
));
}
+ Future<void> test_noDefaultConstructor() async {
+ final content = '''
+ class A {
+ A._();
+ }
+
+ final a = A(^);
+ ''';
+
+ await initialize(
+ textDocumentCapabilities: withSignatureHelpContentFormat(
+ emptyTextDocumentClientCapabilities, [MarkupKind.Markdown]));
+ await openFile(mainFileUri, withoutMarkers(content));
+ await expectNoSignature(content);
+ }
+
Future<void> test_nonDartFile() async {
await initialize(
textDocumentCapabilities: withSignatureHelpContentFormat(
diff --git a/tools/VERSION b/tools/VERSION
index 865c9b1..59fa74d 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 151
+PRERELEASE 152
PRERELEASE_PATCH 0
\ No newline at end of file