提交 14a66241 编写于 作者: J Jason Malinowski

Merge pull request #5024 from jasonmalinowski/async-loading-with-property-pages

Async loading with property pages
......@@ -215,15 +215,15 @@ private void TryProcessOpenForDocCookie(uint docCookie)
uint itemid;
RunningDocumentTable.GetDocumentHierarchyItem(docCookie, out hierarchy, out itemid);
foreach (var project in _projectContainer.GetProjects())
{
var documentKey = new DocumentKey(project, moniker);
var shimTextBuffer = RunningDocumentTable.GetDocumentData(docCookie) as IVsTextBuffer;
if (_documentMap.ContainsKey(documentKey))
if (shimTextBuffer != null)
{
foreach (var project in _projectContainer.GetProjects())
{
var shimTextBuffer = RunningDocumentTable.GetDocumentData(docCookie) as IVsTextBuffer;
var documentKey = new DocumentKey(project, moniker);
if (shimTextBuffer != null)
if (_documentMap.ContainsKey(documentKey))
{
var textBuffer = EditorAdaptersFactoryService.GetDocumentBuffer(shimTextBuffer);
......@@ -257,6 +257,18 @@ private void TryProcessOpenForDocCookie(uint docCookie)
}
}
}
else
{
// This is opening some other designer or property page. If it's tied to our IVsHierarchy, we should
// let the workspace know
foreach (var project in _projectContainer.GetProjects())
{
if (hierarchy == project.Hierarchy)
{
_projectContainer.NotifyNonDocumentOpenedForProject(project);
}
}
}
}
private void OnBeforeDocumentWindowShow(IVsWindowFrame frame, uint docCookie, bool firstShow)
......
......@@ -11,5 +11,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
internal interface IVisualStudioHostProjectContainer
{
IEnumerable<IVisualStudioHostProject> GetProjects();
void NotifyNonDocumentOpenedForProject(IVisualStudioHostProject project);
}
}
......@@ -350,6 +350,11 @@ IEnumerable<IVisualStudioHostProject> IVisualStudioHostProjectContainer.GetProje
return _hostProjects.Values;
}
void IVisualStudioHostProjectContainer.NotifyNonDocumentOpenedForProject(IVisualStudioHostProject project)
{
// Since the MiscellaneousFilesWorkspace doesn't do anything lazily, this is a no-op
}
private class LanguageInformation
{
public LanguageInformation(string languageName, string scriptExtension, ParseOptions parseOptions)
......
......@@ -57,6 +57,12 @@ IEnumerable<IVisualStudioHostProject> IVisualStudioHostProjectContainer.GetProje
return this.Projects;
}
void IVisualStudioHostProjectContainer.NotifyNonDocumentOpenedForProject(IVisualStudioHostProject project)
{
var abstractProject = (AbstractProject)project;
StartPushingToWorkspaceAndNotifyOfOpenDocuments(SpecializedCollections.SingletonEnumerable(abstractProject));
}
private uint? _solutionEventsCookie;
public VisualStudioProjectTracker(IServiceProvider serviceProvider)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册