eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.04k stars 2.5k forks source link

Dynamically add new languages #4157

Closed soerendomroes closed 3 years ago

soerendomroes commented 5 years ago

I want to dynamically add support for new languages to Theia by requesting (or getting notified) by the language server. Currently I use the same procedure to dynamically add syntax highlighting for already registered languages. Dynamically adding new languages however results in not working content assist and other languages features normally provided. But languages I add this way is registered and syntax highlighting works for them.

vince-fugnitto commented 4 years ago

Hi @soerendomroes, do you mind explaining your scenario in more detail? Which generic language server will be responsible for notifying the application?

soerendomroes commented 4 years ago

@vince-fugnitto I use a language server that supports many hierarchical languages. The syntax of each language might change. Therefore I added an Xtext fragment to the languages that automatically generates a list of keywords for each language. Via a service interface I am able to send this list to the Theia client on startup. I want to do the same for the languages.

The language server should send a list of supported languages (together with appropriate keywords for syntax highlighting) to the Theia client. However, I failed to successfully register these languages in my LanguageClientContribution. What I am forced to do is write down and keep track of all languages I have manually.

JonasHelming commented 3 years ago

This seems like a pretty specific issue in your Theia application. Please try to post your question here: https://community.theia-ide.org/ with even more details. Closing this issue due to inactivity

soerendomroes commented 3 years ago

Can you please elaborate why dynamical language registration is a specific issue? Should this normally be possible in a Theia application? @JonasHelming

JonasHelming commented 3 years ago

I don't want to argue, whether it is a specific issue or not. I think I am still missing some more details here. Like can you provide a code example demonstrating what you are trying to do and what exactly fails? Further, do you consider a contribution to fix this issue? I am happy to reopen this issue if you like, I basically closed it cause nobody was reacting to it for over year and I personally was not sure what exactly the issue is. Not about the dynamic registering part but more about "I failed to successfully register these languages in my LanguageClientContribution"

soerendomroes commented 3 years ago

I consider to do it in the future, but keep the issue closed :)