Skip to content

Proposal: Allow a language server to provide a reference content for a specific uri scheme #336

Closed
@david-driscoll

Description

@david-driscoll

A cool feature that atom and vscode has is the ability to take a scheme and the editor would load the text for that scheme from the server instead of from say disk.

This is used in OmniSharp to load metadata of a decompiled types.

A full proposal as per the contributing guidelines to come soon.

New methods

  • workspace/getReferenceDocument - Get text content from the workspace
  • workspace/openDocument - Allow the server to have the client open a document, eg. in response to goto definition on something that doesn't exist.
interface WorkspaceClientCapabilities {
	/**
	 * Capabilities specific to the `workspace/getReferenceDocument` request.
	 */
	referenceDocument?: {
		/**
		 * Execute command supports dynamic registration.
		 */
		dynamicRegistration?: boolean;
	};
	/**
	 * Capabilities specific to the `workspace/openDocument` request.
	 */
	openDocument?: {
		/**
		 * Execute command supports dynamic registration.
		 */
		dynamicRegistration?: boolean;
	};
}

interface ServerCapabilities {
	/**
	 * Capabilities specific to the `workspace/getReferenceDocument` request.
	 */
	referenceDocumentProvider?: {
		/**
		 * Reference schemes supported by this server
		 */
		schemes?: string[];
	};
}

// registration options for `workspace/getReferenceDocument`
interface ReferenceDocumentRegistrationOptions {
	schemes?: string[];
}

// workspace/getReferenceDocument
// request
interface GetSchemeContentParams {
	/**
	 * The text document's URI.
	 */
        uri: DocumentUri;
}
// returns
interface ReferenceDocumentItem {
	/**
	 * The text document's URI.
	 */
	uri: DocumentUri;

	/**
	 * The text document's language identifier.
	 */
	languageId: string;

	/**
	 * The content of the opened text document.
	 */
	text: string;
}

// notification
interface OpenDocumentParams {
	/**
	 * The text document's URI.
	 */
	uri: DocumentUri;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions