sublimelsp / LSP-jdtls

Convenience package for the Eclipse JDT language server
https://packagecontrol.io/packages/LSP-jdtls
MIT License
30 stars 4 forks source link

Work Done Progress leads to `unknown $/progress token` ST console log entries #37

Closed LDAP closed 1 year ago

LDAP commented 1 year ago

Describe the bug ST console is flooded with LSP: unknown $/progress token: <token> when servers report Work Done Progress.

lsp-log.txt

st-log.txt

To Reproduce

  1. Start LSP-jdtls
  2. Check ST console

Expected behavior Nothing is logged to console

Screenshots none

Environment (please complete the following information):

Additional context none

LDAP commented 1 year ago

One example is: LSP log:

:: <-  jdtls $/progress: {'token': '0ed628a5-8838-45bd-896e-65c0deda3dc7', 'value': {'kind': 'begin', 'title': 'Refreshing Maven model', 'message': 'Refreshing Maven model'}}
:: <-  jdtls $/progress: {'token': '0ed628a5-8838-45bd-896e-65c0deda3dc7', 'value': {'kind': 'report', 'percentage': 0, 'message': 'Refreshing Maven model'}}
:: <-  jdtls $/progress: {'token': '0ed628a5-8838-45bd-896e-65c0deda3dc7', 'value': {'kind': 'report', 'percentage': 0, 'message': 'Refreshing Maven model'}}
:: <-  jdtls $/progress: {'token': '0ed628a5-8838-45bd-896e-65c0deda3dc7', 'value': {'kind': 'end', 'message': 'Updating Maven Dependencies'}}
:: <-  jdtls $/progress: {'token': '0ed628a5-8838-45bd-896e-65c0deda3dc7', 'value': {'kind': 'begin', 'title': 'project test_a0aa8f63', 'message': 'Updating Maven Dependencies'}}
:: <-  jdtls $/progress: {'token': '0ed628a5-8838-45bd-896e-65c0deda3dc7', 'value': {'kind': 'end', 'message': 'Updating Maven Dependencies'}}

ST log:

LSP: unknown $/progress token: 0ed628a5-8838-45bd-896e-65c0deda3dc7
LSP: unknown $/progress token: 0ed628a5-8838-45bd-896e-65c0deda3dc7
LSP: unknown $/progress token: 0ed628a5-8838-45bd-896e-65c0deda3dc7
LSP: unknown $/progress token: 0ed628a5-8838-45bd-896e-65c0deda3dc7
LSP: unknown $/progress token: 0ed628a5-8838-45bd-896e-65c0deda3dc7
LSP: unknown $/progress token: 0ed628a5-8838-45bd-896e-65c0deda3dc7
rwols commented 1 year ago

This means the server didn't first request window/workDoneProgress/create. It must do this according to this section.

LDAP commented 1 year ago

Right, I missed that section. Can you transfer this issue to LSP-jdtls?

rwols commented 1 year ago

To be fair, now that I'm reading that section again it mentions

To keep the protocol backwards compatible

But does that mean we didn't have window/workDoneProgress/create before? In any case, it's been a few years now that there's window/workDoneProgress/create.

LDAP commented 1 year ago

I assumed $/progress with kind begin is enough to start progress reporting because of this section:

Work Done Progress Begin To start progress reporting a $/progress notification with the following payload must be sent:

It seems like VSCode and the Vim client both support missing window/workDoneProgress/create requests.

jwortmann commented 1 year ago

To be fair, now that I'm reading that section again it mentions

To keep the protocol backwards compatible

But does that mean we didn't have window/workDoneProgress/create before? In any case, it's been a few years now that there's window/workDoneProgress/create.

I don't think this is the case, and the relevant part of the specs is right at the beginning of that section https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#initiatingWorkDoneProgress

Work Done progress can be initiated in two different ways:

  1. [...]
  2. by a server using the request window/workDoneProgress/create. The document will refer to this kind of progress as server initiated progress.

Note that the link is to the 3.15 version of the specs when "Work Done Progress" was introduced, i.e. this request was always part of it.


Another violation from the server is, that it must not use the same token twice:

The token provided in the create request should only be used once (e.g. only one begin, many report and one end notification should be sent to it).

LDAP commented 1 year ago

A workaround was implemented in LSP package.