Closed Lotes closed 1 week ago
PR Preview Action v1.4.6 :---: Preview removed because the pull request was closed. 2024-09-04 15:31 UTC
@msujew Can you tell me whether there is a common way in Langium to register the disposal of a cache? I explained the method, but have not shown any connection points with Langium.
@Lotes Given that the language server process lives and dies with its connection (and therefore also service container), any global caches (i.e. caches that live as part of a service implementation) are "disposed" as soon as the language server or its owning service container dies. They don't need to be explicitly registered for disposal.
Making these caches disposable was designed for cases in which the cache itself is designed to be short-lived. I assume these cases are fairly rare (we have none in our framework) and there's no recommended way of performing the disposal for now.
Thanks, I added your suggestions, @msujew .
I added a recipe about the document cache. I am also mentioning the other caches (WorkspaceCache, ContextCache and SimpleCache).
I moved this recipe under the category "utilities". Maybe "performance" would be better?