Skip to content

WIP: Get IVsHierarchy from AbstractProject if not available via IVsSolution#36461

Closed
tmat wants to merge 3 commits intodotnet:masterfrom
tmat:FixAddDocument
Closed

WIP: Get IVsHierarchy from AbstractProject if not available via IVsSolution#36461
tmat wants to merge 3 commits intodotnet:masterfrom
tmat:FixAddDocument

Conversation

@tmat
Copy link
Copy Markdown
Member

@tmat tmat commented Jun 14, 2019

@tmat tmat requested a review from a team as a code owner June 14, 2019 18:29
@tmat tmat changed the base branch from master to release/dev16.2-preview3 June 14, 2019 18:29
Copy link
Copy Markdown
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to fix TS move-to-file. Thanks!

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Jun 14, 2019

@jasonmalinowski PTAL

}

#pragma warning disable CS0618 // Type or member is obsolete
var project = _projectTracker.GetProject(projectId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the plan for this once we finally move TypeScript off of this shim? Can we add a comment describing what that plan would be here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I understand this is a useful tactical fix which is good for now.)

Copy link
Copy Markdown
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine as a tactical fix to unblock but we'll need a better plan.

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Jun 14, 2019

Yeah, I don't have a plan yet

@tmat tmat changed the base branch from release/dev16.2-preview3 to master June 14, 2019 20:54
@jinujoseph jinujoseph modified the milestones: 16.2, 16.2.P4 Jun 14, 2019
@sharwell
Copy link
Copy Markdown
Contributor

sharwell commented Jun 17, 2019

Integration tests failure is probably a true failure. Here's the stack for one of the crashes:

Event Time (UTC): 6/14/2019 9:35:09 PM
Event ID: 1025
Data: Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.TryGetHierarchy(ProjectId projectId, IVsHierarchy& hierarchy)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.IsCPSProject(Project project)
   at Microsoft.VisualStudio.LanguageServices.Implementation.DesignerAttribute.DesignerAttributeIncrementalAnalyzer.<IsCpsProjectAsync>d__13.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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.LanguageServices.Implementation.DesignerAttribute.DesignerAttributeIncrementalAnalyzer.<AnalyzeDocumentAsync>d__9.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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor.<>c__DisplayClass32_1`1.<<RunAnalyzersAsync>b__0>d.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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor.<GetOrDefaultAsync>d__35`2.MoveNext()
Stack:
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+<GetOrDefaultAsync>d__35`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResult()
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+<GetOrDefaultAsync>d__35`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.Finish(Boolean)
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetException(System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetException(System.Exception)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+<>c__DisplayClass32_1`1+<<RunAnalyzersAsync>b__0>d[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.Finish(Boolean)
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetException(System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetException(System.Exception)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)
   at Microsoft.VisualStudio.LanguageServices.Implementation.DesignerAttribute.DesignerAttributeIncrementalAnalyzer+<AnalyzeDocumentAsync>d__9.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

@tmat tmat mentioned this pull request Jun 17, 2019
@tmat tmat force-pushed the FixAddDocument branch from 756d9c2 to d2f5c3a Compare June 17, 2019 20:32
@tmat
Copy link
Copy Markdown
Member Author

tmat commented Jun 17, 2019

@sharwell Thanks! I addressed the crash.

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Jun 17, 2019

@jasonmalinowski PTAL again. Now includes the workaround for Project GUID initialization.

@tmat tmat modified the milestones: 16.2.P4, 16.3 Jun 18, 2019
@tmat
Copy link
Copy Markdown
Member Author

tmat commented Jun 18, 2019

We decided to revert the original PR as it uncovered a bug in project system that needs to be fixed first.

@tmat tmat changed the title Get IVsHierarchy from AbstractProject if not available via IVsSolution WIP: Get IVsHierarchy from AbstractProject if not available via IVsSolution Jun 18, 2019
@jasonmalinowski
Copy link
Copy Markdown
Member

@tmat Should this be ignored or closed then?

@tmat tmat closed this Jun 20, 2019
@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jun 26, 2019

@tmat What's the latest on this? Did some version of it get merged and, ideally, inserted?

@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jun 26, 2019

cc @jessetrinity

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Jun 26, 2019

We had to roll the change back because of a Project System bug. Once the bug is fixed we will try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants