Skip to content

Add cache to viewdescriptorservice - #88656

Merged
SteVen Batten (sbatten) merged 12 commits into
microsoft:masterfrom
sbatten:reloadViewCache
Jan 16, 2020
Merged

SteVen Batten (sbatten) merged 12 commits into
microsoft:masterfrom
sbatten:reloadViewCache

Conversation

@sbatten

Copy link
Copy Markdown
Member

refs #85164

@sandy081

Copy link
Copy Markdown
Member

SteVen Batten (@sbatten) Not sure why this looks bit complicated. I am guessing the implementation as follows:

  • Create a IViewDescriptorsCollection for a given container using the location information from ViewDescriptorsRegistry and Storage (cache).
  • You primary source for view descriptors should be ViewDescriptorsRegistry. Listen to ViewDescriptorsRegistry and update view descriptors of IViewDescriptorsCollection based on the location information.

Let me know if I am missing anything else here?

@sandy081

Copy link
Copy Markdown
Member

SteVen Batten (@sbatten)

I think we can do a bit of clean up without your changes and after that your changes can become more simpler. for eg: try removing the events onViewsRegistered and onViewsDeregistered from the service. These events are only used inside the service.


this.viewDescriptorCollections.set(viewContainer, { viewDescriptorCollection, disposable: disposables });

// Check if we have any views that were awaiting container registration due to a cached position

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.

Looks this comment is outdated

const disposables = new DisposableStore();
const viewDescriptorCollection = disposables.add(new ViewDescriptorCollection(this.contextKeyService));
viewDescriptorCollection.addViews(this.viewsRegistry.getViews(viewContainer));
private getViewContainerById(id: string): ViewContainer | undefined {

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.

Is this method does not exist on view container registry? If does not, lets please create one there and use it.

this.deregisterGroupedViews(regroupedViews);
}

private regroupViews(containerId: string, views: IViewDescriptor[], seedMap?: Map<string, IViewDescriptor[]>): Map<string, IViewDescriptor[]> {

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 do not see seedMap is passed any where. So this arg is not needed.

@sandy081

Copy link
Copy Markdown
Member

LGTM. Provided some feedback.

@sbatten

Copy link
Copy Markdown
Member Author

will update and merge thanks

@sbatten
SteVen Batten (sbatten) merged commit dba8d71 into microsoft:master Jan 16, 2020
@sbatten
SteVen Batten (sbatten) deleted the reloadViewCache branch January 16, 2020 18:05
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants