You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@sandy081 you are directly disposing IModel, basically bypassing our reference counting lifecycle model. Is there any reason? This is ugly because it means in my world I also have to listen to IModel getting disposed to dispose my models.
I am unsure why you actually need to first resolve a file reference and then create a new model, could you not just use the same model for the left hand side of the diff editor?
First of all I am disposing the model by myself because I create the model and once model is no longer valid it is disposed even though the references are alive. Use case was that when file matches were cleared all corresponding replace preview models should be disposed. Since there wa no proper disposing strategy for model as mentioned here.
I am not sure if there is a way to pass same URIs for LHS and RHS while opening the editor and show different contents.
Good point about the model, somehow I thought you would dispose the model that was created via the reference. It is still a big ugly because the model you create ends up being send to the outside into my ResourceEditorModel which then has to listen to dispose on IModel to dispose itself, which in turn at some point will just close the editor because the input gets disposed...
I have not better idea right now what to do, closing.
I am hunting through our code to find areas where
IModel
is being disposed directly without going through our reference counted world. Besides file/untitled land that are known to not have this adopted, the only other place I found was in https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/search/browser/replaceService.ts#L80@sandy081 you are directly disposing IModel, basically bypassing our reference counting lifecycle model. Is there any reason? This is ugly because it means in my world I also have to listen to
IModel
getting disposed to dispose my models.I am unsure why you actually need to first resolve a file reference and then create a new model, could you not just use the same model for the left hand side of the diff editor?
fyi @joaomoreno
The text was updated successfully, but these errors were encountered: