Johannes Rieken

Results 171 comments of Johannes Rieken

No 'ABC' icon for me, but the keyword icon. My guess is that this is coming from the C# extension. @DustinCampbell Ideas?

_From @DustinCampbell on April 24, 2017 13:22_ Note that in C#, XML documentation comments aren't precisely "comments". They're very special. Also, in the example, the `` isn't closed, so in...

Yeah, this has come up before (https://github.com/Microsoft/vscode/issues/752) but hasn't been tackled yet. It's a little harder to do without breaking the API because we want to keep the rule "CancellationToken...

> My search for this.dispose yields around 106 results. Should we start project-wide adoption effort to eliminate this? Without knowing them all I would strongly say "YES" Generally, self-disposal is...

Another case seems to be `TextModelContentsProvider` - it will also self-dispose when the underlying text model disposes. Still, the owner `TextModelPromptParser` won't notice and in consequence the `ObjectCache` continues to...

> For instance, we don't generally have control over a text model lifecycle, so if a component relies on a model that suddenly gets disposed by something else, This is...

> Seems there are quite a bit of such places, ppl seem to fall into the same path as it might feel natural to them? In comparison to those (which...

> the text models are required for the providers to be functional, so disposing a provider as soon as it gets dysfunctional makes sense to me; Your provider can ensure...

For those, from the side cases, you should use `IModelService#onModelAdded|onModelRemoved`. Like the pseudo sample below is control and don't rely on self-disposal ``` const store... modelService.onModelAdded(doc => { store.set(doc, new...

> the IDisposable returned from the onWillDispose call with a specific model and dispose them at the same time. That's why I recommend `IModelService#onModelRemoved` - it's the `onDidDispose` event for...