eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
613 stars 145 forks source link

Adjust inheritance tree for SemanticTokensWithRegistrationOptions #573

Closed pisv closed 2 years ago

pisv commented 2 years ago

SemanticTokensWithRegistrationOptions currently extends AbstractWorkDoneProgressOptions. It should probably extend AbstractTextDocumentRegistrationAndWorkDoneProgressOptions instead. This would make it extend TextDocumentRegistrationOptions, from which other similar options are derived (and hence, would allow a greater opportunity for polymorphism).

Formally, this is a breaking API change, but it seems to be a relatively mild one in practice: because AbstractWorkDoneProgressOptions implements the interface WorkDoneProgressOptions, there seems to be little reason for LSP4J consumers to depend on the fact that SemanticTokensWithRegistrationOptions currently extends AbstractWorkDoneProgressOptions (as opposed to just implementing WorkDoneProgressOptions).

WDYT?