fix: list server tools#21
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f220c17e0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| error.code === -32601 || | ||
| error.code === "MethodNotFound" || | ||
| error.code === "METHOD_NOT_FOUND" || | ||
| (error instanceof Error && /unhandled|method not found/i.test(error.message)) |
There was a problem hiding this comment.
Narrow fallback detection to true method-not-found errors
collectFileDiagnostics now falls back to push diagnostics whenever the error message contains "unhandled", even if the RPC error code is not method-not-found. In practice, a pull-diagnostics server can return internal failures like -32603 with messages such as “Unhandled exception…”, and this branch will silently convert that real failure into an ok: true push result (often empty), masking server errors and dropping diagnostics.
Useful? React with 👍 / 👎.
| matchedItems: number, | ||
| limit: number, | ||
| ): unknown[] & { lspMcpMeta?: ReturnType<typeof completionMeta> } { | ||
| return Object.assign(items, { lspMcpMeta: completionMeta(totalItems, matchedItems, limit) }); |
There was a problem hiding this comment.
Return completion metadata in a JSON-serializable shape
For CompletionItem[] responses, withCompletionMeta stores lspMcpMeta as a custom property on an array via Object.assign. Array custom keys are not preserved by JSON serialization, so MCP clients receive only the truncated item list and lose metadata (totalItems, truncated, etc.) needed to understand default limiting/filtering behavior.
Useful? React with 👍 / 👎.
No description provided.