Skip to content

Typescript Extension: Provide public API-surface for extension authors #28912

Closed

Description

@mrcrowl

As an extension author, I'd like access to the same typescript client that is contained within the built-in typescript extension.

Some examples of useful APIs below:

/// [typescriptMain.ts]

export function activate(context: ExtensionContext): DependentExtensionAPI {
    ...

    return {
        // --> typescriptServiceClient.execute
        clientExecute(command: string, args: any, expectsResultOrToken?: boolean | CancellationToken): Promise<any> 

        // --> taskProvider.getTsConfigForActiveFile
        getTsConfigForActiveFile(): Promise<string>
    }
}

export interface DependentExtensionAPI 
{
    clientExecute(command: 'configure', args: Proto.ConfigureRequestArguments, token?: CancellationToken): Promise<Proto.ConfigureResponse>;
    clientExecute(command: 'open', args: Proto.OpenRequestArgs, expectedResult: boolean, token?: CancellationToken): Promise<any>;
    clientExecute(command: 'close', args: Proto.FileRequestArgs, expectedResult: boolean, token?: CancellationToken): Promise<any>;
    clientExecute(command: 'change', args: Proto.ChangeRequestArgs, expectedResult: boolean, token?: CancellationToken): Promise<any>;
    clientExecute(command: 'geterr', args: Proto.GeterrRequestArgs, expectedResult: boolean, token?: CancellationToken): Promise<any>;
    clientExecute(command: 'quickinfo', args: Proto.FileLocationRequestArgs, token?: CancellationToken): Promise<Proto.QuickInfoResponse>;
    clientExecute(command: 'completions', args: Proto.CompletionsRequestArgs, token?: CancellationToken): Promise<Proto.CompletionsResponse>;
    ...
    getTsConfigForActiveFile(): Promise<string>;
}

Dirk Bäumer (@dbaeumer)

Activity

  1. added
    feature-request
    on Jun 30, 2017
  2. mjbvz commented on Dec 19, 2017

    @mjbvz
    Contributor

    Closing as out of scope. If you still think you need some additional data or functionality from TS, please explain what you are trying to achieve and we can work back from there

  3. added
    *out-of-scope
    on Dec 19, 2017
  4. locked and limited conversation to collaborators on Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*out-of-scopefeature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions