DotJoshJohnson / vscode-dotnet

A Visual Studio Code language server implementation for .NET/.NET Core.
http://dotjoshjohnson.github.io/vscode-dotnet/api-docs
MIT License
8 stars 3 forks source link

Signature Feature #3

Open DotJoshJohnson opened 8 years ago

DotJoshJohnson commented 8 years ago

Signature Help

The signature help request is sent from the client to the server to request signature information at a given cursor position.

Changed:: in 2.0 the requests uses TextDocumentPositionParams with a proper textDocument and position property. In 1.0 the uri of the referenced text document was inlined into the params object.

Request

Response

/**
 * Signature help represents the signature of something
 * callable. There can be multiple signature but only one
 * active and only one active parameter.
 */
interface SignatureHelp {
    /**
     * One or more signatures.
     */
    signatures: SignatureInformation[];

    /**
     * The active signature.
     */
    activeSignature?: number;

    /**
     * The active parameter of the active signature.
     */
    activeParameter?: number;
}
/**
 * Represents the signature of something callable. A signature
 * can have a label, like a function-name, a doc-comment, and
 * a set of parameters.
 */
interface SignatureInformation {
    /**
     * The label of this signature. Will be shown in
     * the UI.
     */
    label: string;

    /**
     * The human-readable doc-comment of this signature. Will be shown
     * in the UI but can be omitted.
     */
    documentation?: string;

    /**
     * The parameters of this signature.
     */
    parameters?: ParameterInformation[];
}
/**
 * Represents a parameter of a callable-signature. A parameter can
 * have a label and a doc-comment.
 */
interface ParameterInformation {
    /**
     * The label of this signature. Will be shown in
     * the UI.
     */
    label: string;

    /**
     * The human-readable doc-comment of this signature. Will be shown
     * in the UI but can be omitted.
     */
    documentation?: string;
}