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) {