No Xtext languages have been registered [message #1844253] |
Tue, 07 September 2021 04:25  |
Eclipse User |
|
|
|
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.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03807 seconds