Skip to content

feat: Remove final modifier from *Message methods in DefaultLanguageClient#1370

Merged
rubenporras merged 1 commit intoeclipse-lsp4e:mainfrom
FlorianKroiss:make-default-language-client-extensible
Nov 7, 2025
Merged

feat: Remove final modifier from *Message methods in DefaultLanguageClient#1370
rubenporras merged 1 commit intoeclipse-lsp4e:mainfrom
FlorianKroiss:make-default-language-client-extensible

Conversation

@FlorianKroiss
Copy link
Copy Markdown
Contributor

This makes it easier for developers using LSP4E to create a language client with custom behavior.

Resolves #1367

@rubenporras
Copy link
Copy Markdown
Contributor

Could it be that for your use case it could be better to allow customization of the ServerMessageHandler? Can you please provide more info about why this is necessary to change the logging behaviour in your case?

@FlorianKroiss
Copy link
Copy Markdown
Contributor Author

Can you please provide more info about why this is necessary to change the logging behaviour in your case?

Our application has a Log View which displays log messages coming from all over the application, to make it easier for users to diagnose problems. This includes log messages coming the LSP4E Plugin.

We are using a language server which is quite verbose during startup and publishes a lot of INFO messages which are handled by DefaultLanguageClient.logMessage(). I would like to lower their log-level to DEBUG to reduce the log noise before handing the messages to the logger, but I can't intercept the message because logMessage is final.

Could it be that for your use case it could be better to allow customization of the ServerMessageHandler?

Making the logging behavior in ServerMessageHandler configurable would probably work, but a developer might only want to change the log level if the message comes from a specific LS or has certain content.

Given that every custom LanguageClient must be a subclass of DefaultLanguageClient, I thought that it's reasonable to make all of it's functionality overridable. For example, a developer might also want to change how showMessage is handled.

@rubenporras
Copy link
Copy Markdown
Contributor

Could we just remove the final from the *Message methods only?

@rubenporras rubenporras self-requested a review November 7, 2025 12:14
@FlorianKroiss
Copy link
Copy Markdown
Contributor Author

That's fine for me.

@FlorianKroiss FlorianKroiss force-pushed the make-default-language-client-extensible branch from fcaf8ec to 649b0a7 Compare November 7, 2025 12:40
@FlorianKroiss FlorianKroiss changed the title feat: Remove final modifier from all methods in DefaultLanguageClient feat: Remove final modifier from *Message methods in DefaultLanguageClient Nov 7, 2025
@rubenporras rubenporras merged commit 4ec874a into eclipse-lsp4e:main Nov 7, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make all methods in DefaultLanguageClient non-final

2 participants