Lsp custom requests

From forcedotcom/salesforcedx-vscode · View interactive version

Lsp custom requests is an AI agent skill from the GitHub repository forcedotcom/salesforcedx-vscode. Serialize URIs correctly across LSP custom requests. Use when defining custom LSP requests/notifications with URI params, sending a `URI` over `Connection.sendRequest`, or debugging `[object Object]` / `EntryNotFound` / `workspace/stat`/`readFile`/`readDirectory` failures.

How to use this skill

Skill file

LSP Custom Requests — URI Wire Format

Why it breaks

Rules

Pattern — UriComponents + revive

Params type derived from URI.toJSON:

import type { URI } from 'vscode-uri';
type UriComponents = ReturnType<URI['toJSON']>;
type MyParams = { uri: UriComponents };

const params: MyParams = { uri: URI.parse(fileUri) };
connection.sendRequest('my/request', params);

const handler = (params: MyParams) => {
  const uri = URI.revive(params.uri);
};

Notes:

Don't

When `uri: URI` in params looks fine but isn't

Compiles cleanly (URI on both sides). Runtime receiver sees a plain UriComponents. Check the handler log — uri=[object Object] confirms.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.