It was observed, that while using the typescript editor support in NetBeans to work with angular projects, the whole system became sluggish. Parts of this can be attributed to having `ng serve` running in the background and using many resources when compiling, but that could not be the whole story.
Checking the task manager showed, that the taskgroup of netbeans contained more than 500 processes. The problem was reproducible.
Running with a debugger showed, that a breakpoint placed in org.netbeans.modules.typescript.editor.TypeScriptLSP.startServer(Lookup) was hit multiple times in a short time frame although only one file was opened.
This can be tracked back int org.netbeans.modules.lsp.client.LSPBindings.getBindingsImpl(Project, FileObject, String, boolean) where the map `project2MimeType2Server` provides a cache, that should yield the same LSP server if a project is present or at least the same lsp server for a directory.
This caching does not work. The cache is a WeakHashMap with an URI as key. The uri is created in the `getBindingsImpl` method and becomes immediately eligible for GC. In consequence the next access will fail to retrieve the previously created LSP as the key got GCed.
TL;DR: Caching does not work.
The problem seems to be introduced recently as it was only observed since a few weeks. Most probably it was introduced when support for LSP without project reference was introduced:
At that point the cache was switched from Project to URI. The Project is kept alive by the IDE, so the cache should have worked at that time.