commit | 28bae4c42eae6837733d91c79742fd7b3fe4cf66 | [log] [tgz] |
---|---|---|
author | Konstantin Shcheglov <scheglov@google.com> | Mon Mar 11 21:53:38 2024 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Mar 11 21:53:38 2024 +0000 |
tree | 08895f22c2a085dad0fad325f5aed23b2251297c | |
parent | e3847ee15b1c67dfd253808b51cd1001a6c1f821 [diff] |
Completion. Issue 45429. Remove debug output. We decided to make BodyInferenceContext.of() nullable. Bug: https://github.com/dart-lang/sdk/issues/45429 Change-Id: Ifb18936e860da2c91050fb02539d68106b0979ec Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356922 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Keerti Parthasarathy <keertip@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart index 53e9542..edc2ffd 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
@@ -625,16 +625,7 @@ if (range.endEnd(node.functionDefinition, node).contains(offset)) { var parent = node.parent; if (parent is MethodDeclaration) { - var bodyContext = BodyInferenceContext.of(parent.body); - // TODO(scheglov): https://github.com/dart-lang/sdk/issues/45429 - if (bodyContext == null) { - throw StateError(''' -Expected body context. -Method: $parent -Class: ${parent.parent} -'''); - } - return bodyContext.contextType; + return BodyInferenceContext.of(parent.body)?.contextType; } else if (parent is FunctionExpression) { var grandparent = parent.parent; if (grandparent is FunctionDeclaration) {