LSP4E connected to Xtext Language Server does not show errors in the editor

Currently I'm testing a Xtext grammar by using the Language Server configuration specified in the Xtext documentation (see here). As I understand from that documentation, the text editor should be able to

explore the supported language features like syntax highlighting, content assist, validation, displaying code lenses, quickfixes, formatting

However on my side the editor just shows some things as code completion but does not show validation errors (e.g. underlining the problems). Moreover the "Problems" view appears empty even though the language server communication log correctly shows the validation errors being sent to the client.

Is there something more to be done on the Eclipse configuration (specific to lsp4e) which may be overlooked in the Xtext documentation for Language Server?

Thanks in advance.

UPDATE

As stated on the comments the versions used are the following:

On one side the language server using Xtext version 2.27.0 which works with lsp4j 0.14.0.v20220526-1518. On the other side (as client) Eclipse IDE using lsp4e 0.13.13.202207281726 and lsp4j 0.14.0.v20220526-1518

I've been able to debug lsp4e in the scenario and it seems to fail because the call to:

@Override
public final void publishDiagnostics(PublishDiagnosticsParams diagnostics) {
    diagnosticConsumer.accept(diagnostics);
}

in LanguageClientImpl results in a NPE because of diagnosticConsumer being null.

By taking a look who initializes the diagnosticConsumer I see that it is only initialized if the LanguageServerDefinition being used is of type ExtensionLanguageServerDefinition. However in my scenario the LanguageServerDefinition used is of type LaunchConfigurationLanguageServerDefinition (which may be related with the fact that the Language Server configuration associates a content-type with a Java launch configuration).

Any ideas of what I could be missing?

UPDATE 2

I've opened an issue in GitHub where a discussion is ongoing.

Upvotes: 0

Views: 337

Answers (1)

The issue has been solved here. After using the patched version of LSP4E I'm able to see the errors on the UI.

Upvotes: 0

Related Questions