@vscode-mcp/vscode-mcp-ipc
Version:
IPC communication layer between MCP Server and VSCode extension
75 lines • 2.65 kB
JavaScript
/**
* Get symbol LSP info event types and schemas
* This combines all LSP-related symbol information queries into one unified tool
*/
import { z } from 'zod';
import { LocationSchema, RangeSchema, SymbolLocatorSchema } from '../common.js';
/**
* LSP info types that can be requested
*/
export const LSPInfoTypeSchema = z.enum([
'hover',
'signature_help',
'type_definition',
'definition',
'implementation',
'all'
]);
/**
* Hover schema
*/
const HoverSchema = z.object({
contents: z.union([z.string(), z.array(z.string())]),
range: RangeSchema.optional(),
}).strict();
/**
* Parameter information schema for signature help
*/
const ParameterInformationSchema = z.object({
label: z.string(),
documentation: z.string().optional(),
}).strict();
/**
* Signature information schema
*/
const SignatureInformationSchema = z.object({
label: z.string(),
documentation: z.string().optional(),
parameters: z.array(ParameterInformationSchema).optional(),
}).strict();
/**
* Signature help schema
*/
const SignatureHelpSchema = z.object({
signatures: z.array(SignatureInformationSchema),
activeSignature: z.number().optional(),
activeParameter: z.number().optional(),
}).strict();
/**
* Get symbol LSP info input schema
*/
export const GetSymbolLSPInfoInputSchema = SymbolLocatorSchema.extend({
infoType: LSPInfoTypeSchema.optional().default('all').describe(`Type of LSP information to retrieve.
**Info Types Available:**
- **all**(default): Returns all available information
- **hover**: Rich type information and documentation
- **signature_help**: Function parameters and overloads
- **type_definition**: Where the symbol's type is defined
- **definition**: Where the symbol is defined
- **implementation**: All implementations of interfaces/abstract classes`),
}).strict();
/**
* Get symbol LSP info output schema
*/
export const GetSymbolLSPInfoOutputSchema = z.object({
hover: z.array(HoverSchema).optional().describe('Hover information for the symbol'),
signature_help: SignatureHelpSchema.nullable().optional().describe('Function signature help information'),
type_definition: z.array(LocationSchema).optional().describe('Symbol type definition locations'),
definition: z.array(LocationSchema).optional().describe('Symbol definition locations'),
implementation: z.array(LocationSchema).optional().describe('Symbol implementation locations'),
}).strict();
/**
* Internal types for schema composition - not exported to avoid conflicts
* These types are already exported by their respective modules
*/
//# sourceMappingURL=get-symbol-lsp-info.js.map