Skip to content

fix(lsp): omit null diagnostic request fields#147

Merged
bug-ops merged 1 commit into
bug-ops:mainfrom
dergachoff:fix/diagnostics-omit-null-fields
May 24, 2026
Merged

fix(lsp): omit null diagnostic request fields#147
bug-ops merged 1 commit into
bug-ops:mainfrom
dergachoff:fix/diagnostics-omit-null-fields

Conversation

@dergachoff
Copy link
Copy Markdown
Contributor

Problem

get_diagnostics fails against tsgo --lsp --stdio because mcpls sends textDocument/diagnostic params with absent optional fields serialized as JSON null:

{
  "identifier": null,
  "previousResultId": null
}

tsgo's Go LSP decoder rejects this with:

InvalidParams: ... within "/identifier": null value is not allowed for field "identifier"

Fix

Use a small diagnostics request params type that omits absent identifier and previousResultId fields instead of serializing them as null.

Validation

  • cargo +nightly fmt --check
  • cargo +1.95 test -p mcpls-core
  • cargo +1.95 clippy -p mcpls-core --all-targets --all-features -- -D warnings
  • Fresh local MCP probe against tsgo: get_diagnostics returns diagnostics instead of the identifier: null protocol error

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes mcpls-core mcpls-core crate changes labels May 7, 2026
@bug-ops
Copy link
Copy Markdown
Owner

bug-ops commented May 24, 2026

Thanks for the fix! Clean and well-targeted. Opened #166 to track removing the workaround once lsp-types fixes upstream.

@bug-ops bug-ops merged commit ab9f393 into bug-ops:main May 24, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation mcpls-core mcpls-core crate changes rust Rust code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants