Namespace import no longer works since XText 2.21.0 [message #1844442] |
Tue, 14 September 2021 08:00  |
Eclipse User |
|
|
|
Situation:
I have created a language server that uses 4 Xtext projects, each with their own grammar.
When I build the language server using Xtext 2.21.0 and I use the IntelliJ LSP plugin to run the language server, everything works as expected. I can open a file and if I use the correct namespace import I can click on references from other files and the files are opened.
However since XText 2.21.0 this no longer works. The references are only resolved when I have the files containing the definitions being referenced to open in IntelliJ. This defeats the purpose of the "go to definition" functionality in a language server.
Does anyone have any idea why this might be the case?
|
|
|
|
Re: Namespace import no longer works since XText 2.21.0 [message #1844454 is a reply to message #1844449] |
Tue, 14 September 2021 12:41   |
Eclipse User |
|
|
|
Hi Christian, thank you for your reply.
Yes I made sure that I am using the correct IntelliJ plugin. I previously used the wrong one and constantly got errors about the "Widget" not being able to initialise.
I think it has something to do with the code introduced in the LanguageServerImpl (org.eclipse.xtext.ide) in the "initialize" method. There is now code to check if "workspace" configuration is supported. If that is the case it will use workspace folders instead of the base directory. In IntelliJ I don't have workspaces and I think that the "check if workspace is supported" method for some reason is returning "true".
I need a way to tell the Language server to just use the base directory again (as it did in 2.20.0). Is there any way to do this?
Also: Is there a "How to" somewhere about debugging the Language server?
|
|
|
Re: Namespace import no longer works since XText 2.21.0 [message #1844456 is a reply to message #1844442] |
Tue, 14 September 2021 13:02   |
Eclipse User |
|
|
|
Evertson Croes wrote on Tue, 14 September 2021 08:00Situation:
I have created a language server that uses 4 Xtext projects, each with their own grammar.
When I build the language server using Xtext 2.21.0 and I use the IntelliJ LSP plugin to run the language server, everything works as expected. I can open a file and if I use the correct namespace import I can click on references from other files and the files are opened.
However since XText 2.21.0 this no longer works. The references are only resolved when I have the files containing the definitions being referenced to open in IntelliJ. This defeats the purpose of the "go to definition" functionality in a language server.
Does anyone have any idea why this might be the case?
I meant "When I build the language server using XText 2.20.0 and I use the IntelliJ LSP plugin to run the language server, everything works as expected.
|
|
|
|
Re: Namespace import no longer works since XText 2.21.0 [message #1844488 is a reply to message #1844457] |
Wed, 15 September 2021 06:34   |
Eclipse User |
|
|
|
Hi Christian,
Indeed I can see there is a change in how the Workspace is initialised from version 2.21.0. Is there a way I can give a configuration or parameter to the server launcher so that it uses the BaseDir just as it did in version 2.20.0?
I have a feeling that that will fix my problem.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05274 seconds