Skip to content

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

Open
dergachoff wants to merge 1 commit into
bug-ops:mainfrom
dergachoff:fix/diagnostics-omit-null-fields
Open

fix(lsp): omit null diagnostic request fields#147
dergachoff wants to merge 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
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.

1 participant