Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP diagnosticProvider seems not following the specifications #12154

Closed
danillos opened this issue Aug 26, 2023 · 0 comments · Fixed by #12158
Closed

LSP diagnosticProvider seems not following the specifications #12154

danillos opened this issue Aug 26, 2023 · 0 comments · Fixed by #12158
Labels

Comments

@danillos
Copy link

danillos commented Aug 26, 2023

Expected behavior

Rubocop should send diagnosticProvider as DiagnosticOptions or DiagnosticRegistrationOptions based on the spec here: microsoft/language-server-protocol@df3e8a2/_specifications/lsp/3.17/general/initialize.md?plain=1#L861-L866

More details of the issue here: helix-editor/helix#7861

Actual behavior

Rubocop is sending diagnosticProvider as true

Steps to reproduce the problem

Setup rubocop LSP on Helix Editor as:

[language-server.rubocop]
command = "rubocop"
args = ["--lsp", "--stderr", "--fail-level", "fatal"]
timeout = 3


[[language]]
name = "ruby"
language-servers = ["rubocop"]
auto-format = true

RuboCop version

1.56.1 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [arm64-darwin22]
@koic koic added the bug label Aug 27, 2023
koic added a commit to koic/rubocop that referenced this issue Aug 27, 2023
Fixes rubocop#12154.

This PR fixes incorrect `diagnosticProvider` value of LSP.

`diagnosticProvider` cannot accept true as below. This PR replaces the originally acceptable value.

```typescript
/**
 * The server has support for pull model diagnostics.
 *
 * @SInCE 3.17.0
 */
diagnosticProvider?: DiagnosticOptions | DiagnosticRegistrationOptions;
```

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize
bbatsov pushed a commit that referenced this issue Aug 28, 2023
Fixes #12154.

This PR fixes incorrect `diagnosticProvider` value of LSP.

`diagnosticProvider` cannot accept true as below. This PR replaces the originally acceptable value.

```typescript
/**
 * The server has support for pull model diagnostics.
 *
 * @SInCE 3.17.0
 */
diagnosticProvider?: DiagnosticOptions | DiagnosticRegistrationOptions;
```

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize
koic added a commit to koic/standard that referenced this issue Aug 30, 2023
## Summary

This PR fixes incorrect `diagnosticProvider` value of LSP.

`diagnosticProvider` cannot accept `true` as below. This PR replaces the originally acceptable value.

```typescript
/**
 * The server has support for pull model diagnostics.
 *
 * @SInCE 3.17.0
 */
diagnosticProvider?: DiagnosticOptions | DiagnosticRegistrationOptions;
```

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize

## Additional Information

This issue was found in rubocop/rubocop#12154.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants