Skip to main content



      Home
Home » Modeling » TMF (Xtext) » No Xtext languages have been registered
No Xtext languages have been registered [message #1844253] Tue, 07 September 2021 04:25 Go to next message
Eclipse UserFriend
Hi, I'm trying to add XText LSP to an existing XText language. What I did is I create a fresh project with the same language name and copy the ide module from the fresh XText project to the existing one.

The existing project has another class, where all the CLI operation's entry points are (let call it CLI.java). So I create a class called RunLSP inside the ide module, which contains a simple entry to ServerLauncher like this:
public class RunLSP {
	public static void run() {
		ServerLauncher.main(null);
	}
}


And then, in the CLI.java, I import RunLSP to headless and use RunLSP.run(). When the language server starts. It prints out a stack trace and complains that there is no language registered and I should put the setup class inside 'src-gen/META-INF/services/org.eclipse.xtext.ISetup'. The problem is the file is already there so I really don't know what to do.
SEVERE: Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
        at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
        at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
        at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
        at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
        at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
        at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
        ... 11 more
Caused by: java.lang.IllegalStateException: No Xtext languages have been registered. Please make sure you have added the languages's setup class in '/META-INF/services/org.eclipse.xtext.ISetup'
        at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:210)
        ... 16 more


Does anyone know how to solve this? Thank you very much.
Re: No Xtext languages have been registered [message #1844272 is a reply to message #1844253] Tue, 07 September 2021 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Does your project use the new workflow and project setup as the wizard creates them for new projects
? Is there a meta-und/services generated in Sri-gen of ide project ?
Re: No Xtext languages have been registered [message #1844312 is a reply to message #1844272] Wed, 08 September 2021 13:01 Go to previous messageGo to next message
Eclipse UserFriend
Honestly I don't know, the project was create a long time ago (14 years I think). I will redirect your question to my colleagues.
Re: No Xtext languages have been registered [message #1844317 is a reply to message #1844312] Wed, 08 September 2021 14:03 Go to previous message
Eclipse UserFriend
Then you need to port to the new workflow
(Check what the Wieses creates and or create a new project and copy code over
Previous Topic:Validator
Next Topic:Expression Language Formatting and Quickfixes
Goto Forum:
  


Current Time: Mon May 12 23:12:25 EDT 2025

Powered by FUDForum. Page generated in 0.03807 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top