-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Enhance views service #87505
Enhance views service #87505
Conversation
Went through the changes. They make sense and I have following suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provided feedback in the comment
@sbatten If the splitup of the |
@sandy081 @isidorn I explored splitting up the panelpart and panelservice as well as alternatives. I settled on delaying the viewsservice's usage of panel service by using the panel registry directly. its not the perfect solution but i found it better than the timeout as well as significantly simpler than the splitting of the panelpart/service. |
@sandy081 I'm not sure I understand the model suggestion above. The interfaces look similar but the actual logic is a bit different. When I tried to logic it out, I felt like I was adding an equivalent amount of code with not much benefit. Perhaps we should have a call in the morning. |
@@ -281,6 +281,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService { | |||
} | |||
|
|||
private onPanelOpen(panel: IPanel): void { | |||
const viewsService = this.instantiationService.invokeFunction(accessor => accessor.get(IViewsService)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed I suppose as you are having IViewService
defined in the constructor
} | ||
|
||
private async openComposite(compositeId: string, location: ViewContainerLocation, focus?: boolean): Promise<IPaneComposite | undefined> { | ||
const panelService = this.instantiationService.invokeFunction(accessor => accessor.get(IPanelService)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is correct usage of services. If it is difficult to extract panel part, how about extracting views service into IViewDescriptorService
and IViewsService
? Former deals only with view and view container descriptors and later deals with views (opening, focusing etc) ?
Re model suggestions: ViewsService and ViewsRegistry are maintaining stores for view descriptors. My suggestion is to have a Not sure if I will be available for call today as I might be leaving early. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I would prefer calling IViewOpenerService
as IViewService
as it is dealing with views and the current IViewOpenerService
as IViewDescriptorService
as it is dealing with view descriptors.
Add view-moving functionality to viewsservice which has been renamed to viewdescriptorservice. also includes outline view moving
refs #87461
@sandy081 let me know if this looks on the right path. I ran into an issue with the views service now depending on the panel service and the panel service depending on the views service, both in the constructor. you can see I work around this with the instantiation service but still the panel service needs delay its panel registration call somehow (see setTimeout call in constructor). I don't think this part is quite right so I'm looking for suggestions. Depending on a few things, sometimes I see the outline view rendered twice in the panel when moved during testing so need to iron that out as well. I think it might just be caused by the setTimeout though.