Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: syntax node is not within syntax tree #39296

Closed
vsfeedback opened this issue Oct 15, 2019 · 6 comments
Closed

Editor: syntax node is not within syntax tree #39296

vsfeedback opened this issue Oct 15, 2019 · 6 comments
Assignees
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com
Milestone

Comments

@vsfeedback
Copy link

vsfeedback commented Oct 15, 2019

[Happens in 16.4.0-preview-3.0-[29409.185.master]

This issue has been moved from a ticket on Developer Community.


[regression] [worked-in:Not sure about prev, 16.3 works for sure]

  1. Get latest Int Preview Visual Studio.
  2. git clone https://github.com/NuGet/NuGet.Client
  3. Follow the instructions up to configure.ps1
  4. Open NuGet.sln in Visual Studio.

After the solution was fully loaded the moment I started type, a yellow bar popped with,
an error occured, see log file. Clicking on that opens the activity log in the default xml viewer.

In there I found the below.
Note that there could be other problems, but this error was related to types of issues I was seeing.

<entry>
    <record>2738</record>
    <time>2019/10/11 18:15:44.663</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Syntax node is not within syntax tree
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.CheckSyntaxNode(CSharpSyntaxNode syntax)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfoFromNode(SyntaxNode node, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken)
   at SyntaxTree.VisualStudio.Unity.Documentation.UnityQuickInfoSource.<GetRelatedFieldSymbolAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SyntaxTree.VisualStudio.Unity.Documentation.UnityQuickInfoSource.<GetDocumentationFromSymbolAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SyntaxTree.VisualStudio.Unity.Documentation.UnityQuickInfoSource.<GetQuickInfoItemAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<ComputeSourceContentAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<UpdateAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoPresentationSession.<UpdateAsync>d__5.MoveNext()
---> (Inner Exception #0) System.ArgumentException: Syntax node is not within syntax tree
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.CheckSyntaxNode(CSharpSyntaxNode syntax)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfoFromNode(SyntaxNode node, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken)
   at SyntaxTree.VisualStudio.Unity.Documentation.UnityQuickInfoSource.<GetRelatedFieldSymbolAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SyntaxTree.VisualStudio.Unity.Documentation.UnityQuickInfoSource.<GetDocumentationFromSymbolAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SyntaxTree.VisualStudio.Unity.Documentation.UnityQuickInfoSource.<GetQuickInfoItemAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<ComputeSourceContentAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---
</description>
  </entry>

Original Comments

Visual Studio Feedback System on 10/11/2019, 08:09 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Visual Studio Feedback System on 10/15/2019, 02:09 AM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

@jinujoseph jinujoseph added Area-IDE Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Bug labels Oct 15, 2019
@jinujoseph jinujoseph added this to the 16.4 milestone Oct 15, 2019
@jinujoseph jinujoseph modified the milestones: 16.4, 16.5 Dec 11, 2019
@jinujoseph jinujoseph modified the milestones: 16.5, Backlog Feb 21, 2020
@sharwell
Copy link
Member

I just hit this in 16.6 Preview 3 with a slightly different stack:

Syntax node is not within syntax tree
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.CheckSyntaxNode(CSharpSyntaxNode syntax)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfoFromNode(SyntaxNode node, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.QuickInfo.CSharpSemanticQuickInfoProvider.TryGetNullabilityAnalysis(Workspace workspace, SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.QuickInfo.CommonSemanticQuickInfoProvider.<CreateContentAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.QuickInfo.CommonSemanticQuickInfoProvider.<BuildQuickInfoAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.QuickInfo.CommonQuickInfoProvider.<GetQuickInfoAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.QuickInfo.CommonQuickInfoProvider.<GetQuickInfoAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.QuickInfo.QuickInfoServiceWithProviders.<GetQuickInfoAsync>d__5.MoveNext()

@sharwell
Copy link
Member

sharwell commented Apr 20, 2020

@JoeRobich just hit this again. Same stack as #39296 (comment)

@sharwell
Copy link
Member

@JoeRobich I just hit this again. Same stack as #39296 (comment).

@sharwell
Copy link
Member

@JoeRobich I just hit this again

@ooples
Copy link

ooples commented Mar 4, 2022

@JoeRobich I also got this error using the latest visual studio preview version

at 
Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.CheckSyntaxNode(CSharpSyntaxNode 
syntax)<BR>at 
Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDeclaredSymbol(VariableDeclaratorSyntax 
declarationSyntax, CancellationToken cancellationToken)<BR>at 
Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetDeclaredSymbolCore(SyntaxNode 
node, CancellationToken cancellationToken)<BR>at 
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.InternalElements.AbstractCodeElement.LookupSymbol()<BR>at 
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.InternalElements.CodeVariable.GetSymbolType()<BR>at 
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.InternalElements.CodeVariable.get_Type()<BR>at 
EnvDTE.CodeVariable.get_Type()<BR>at 
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnTypePopulateMembers(Object 
sender, EventArgs e)<BR>at 
System.CodeDom.CodeTypeDeclaration.get_Members()<BR>at 
Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.CodeTypeDeclarationPopulator.OnPopulateMembers(Object 
sender, EventArgs e)<BR>at 
System.CodeDom.CodeTypeDeclaration.get_Members()<BR>at 
Microsoft.WinForms.DesignTools.Client.Loader.RemoteCodeDomDesignerLoader.EnsureInitializeComponentStatementsPopulated()<BR>at 
Microsoft.WinForms.DesignTools.Client.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 
manager)<BR>at 
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 
serializationManager)<BR>--- End of stack trace from previous location where 
exception was thrown ---<BR>at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<BR>at 
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 
serializationManager)<BR>at 
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost 
host)

@CyrusNajmabadi
Copy link
Member

Closing out as we haven't gotten a report of this in 4 years, and tehre's nothing in prism for this.

@CyrusNajmabadi CyrusNajmabadi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
@dotnet dotnet locked and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com
Projects
None yet
Development

No branches or pull requests

6 participants