Problems with uncooperative language servers

A couple of language server (omnisharp, python, currently java) are not picking up when new projects are created inside the currently open folder.
I know that we can restart the language server plugins by doing a browser refresh. However, that is quite disrupting. Does anyone see a clear way how we could restart the relevant plugins in a “cheaper” way?

[original thread by Thomas Mäder]

[amiramw]

The same issues exist also on vscode?

~Is it about Theia extensions or VS Code extensions?~ read again, about plugins

Maybe an extension is activated too eagerly before project files are in the workspace.

i.e java extension should not be activated eagerly: https://github.com/redhat-developer/vscode-java/blob/89d3921d6bea902ac4f8626bff165e120c534c25/package.json#L29-L34

you can try whether this PR helps https://github.com/theia-ide/theia/pull/5649

if it is the same in VS Code, then vscode extensions or language servers should be improved to listen to workspace changes and pick up new projects.

I think early activation is one thing that aggravates this problem, but you can always have the case where you have one project open and you clone a second one in the same base folder.

The problem is: language servers in real life don’t pick this up (Python LS from Microsoft comes to mind).

In an environment like Che, where our project location is basically fixed and we auto-open the IDE, the problem happens more often.

That’s why I was looking for a way to mitigate the issue a bit.