Open vsfeedback opened 7 months ago
Feature 'Missing import discovery' is currently unavailable due to an internal error.
StreamJsonRpc.RemoteInvocationException: Object reference not set to an instance of an object.
at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__151`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__22`1.MoveNext()
RPC server exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol.get_ParameterCount()
at Microsoft.CodeAnalysis.CSharp.InMethodBinder.LookupSymbolsInSingleBinder(LookupResult result, String name, Int32 arity, ConsList`1 basesBeingResolved, LookupOptions options, Binder originalBinder, Boolean diagnose, CompoundUseSiteInfo`1& useSiteInfo)
at Microsoft.CodeAnalysis.CSharp.Binder.LookupSymbolsInternal(LookupResult result, String name, Int32 arity, ConsList`1 basesBeingResolved, LookupOptions options, Boolean diagnose, CompoundUseSiteInfo`1& useSiteInfo)
at Microsoft.CodeAnalysis.CSharp.Binder.BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol(IdentifierNameSyntax node, BindingDiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics, NamespaceOrTypeSymbol qualifierOpt)
at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeOrAliasSymbol(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindTypeOrAlias(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.AnalyzeAnonymousFunction(AnonymousFunctionExpressionSyntax syntax, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.IdentifierUsedAsValueFinder.CheckLambda(AnonymousFunctionExpressionSyntax lambdaSyntax, Binder enclosingBinder)
at Microsoft.CodeAnalysis.CSharp.Binder.IdentifierUsedAsValueFinder.CheckIdentifiersInNode(CSharpSyntaxNode node, Binder binder)
at Microsoft.CodeAnalysis.CSharp.Binder.CapturedParametersFinder.<GetCapturedParameters>g__checkParameterReferencesInMethodBody|4_2(CSharpSyntaxNode syntaxNode, Binder bodyBinder, <>c__DisplayClass4_0&)
at Microsoft.CodeAnalysis.CSharp.Binder.CapturedParametersFinder.GetCapturedParameters(SynthesizedPrimaryConstructor primaryConstructor)
at Microsoft.CodeAnalysis.CSharp.Symbols.SynthesizedPrimaryConstructor.GetCapturedParameters()
at Microsoft.CodeAnalysis.CSharp.Symbols.SynthesizedPrimaryConstructor.GetBackingFields()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.AddSynthesizedTypeMembersIfNecessary(MembersAndInitializersBuilder builder, DeclaredMembersAndInitializers declaredMembersAndInitializers, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.AddSynthesizedMembers(MembersAndInitializersBuilder builder, DeclaredMembersAndInitializers declaredMembersAndInitializers, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.BuildMembersAndInitializers(BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetMembersAndInitializers()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.MakeAllMembers(BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetMembersByNameSlow()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceModuleSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSourceDeclarationDiagnostics(SyntaxTree syntaxTree, Nullable`1 filterSpanWithinTree, Func`4 locationFilterOpt, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForSyntaxTree(CompilationStage stage, SyntaxTree syntaxTree, Nullable`1 filterSpanWithinTree, Boolean includeEarlierStages, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDiagnostics(Nullable`1 span, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1.GetUniqueFixesAsyncInCurrentProcessAsync(Document document, TextSpan span, ImmutableArray`1 diagnosticIds, ISymbolSearchService symbolSearchService, AddImportOptions options, ImmutableArray`1 packageSources, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1.GetUniqueFixesAsync(Document document, TextSpan span, ImmutableArray`1 diagnosticIds, ISymbolSearchService symbolSearchService, AddImportOptions options, ImmutableArray`1 packageSources, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteMissingImportDiscoveryService.<>c__DisplayClass4_0.<<GetUniqueFixesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass9_0`1.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunServiceImplAsync[T](Func`2 implementation, CancellationToken cancellationToken)
The stack doesn't have sufficient information for us to track down this crash. It seems likely that _methodSymbol
is null
but can't be certain. Think the next step here is to enable nullable checking in this file, add some asserts and see where that leads us.
From the stack, this looks similar to https://github.com/dotnet/roslyn/issues/71400 and https://github.com/dotnet/roslyn/issues/72862.
Could the NullReferenceException
be the result of re-entrancy calculating MethodSymbol.Parameters
, in this case when binding a type from a lambda parameter perhaps?
This issue has been moved from a ticket on Developer Community.
[severity:I'm unable to use this version] [regression] [worked-in:The one before 17.9.6] I'm getting internal errors that impact syntax highlighting. It seems to be internal errors, possibly related to the recent updates. I can't do any coding as I can't trace references.
Original Comments
Feedback Bot on 4/11/2024, 08:54 PM:
(private comment, text removed)
Original Solutions
(no solutions)