Skip to content

Add version check when loading tsserver plugins #19224

Closed
@mjbvz

Description

@mjbvz

Problem
A TS Server plugin may depend on a TypeScript API that is only available in specific versions of typescript, such as TS 2.6+ for example. Currently the TypeScript server will always attempt to load this plugin, even if it does not meet those requirements.

Proposal
In the plugin's package.json, add a engines: typescriptserver section:

{
     "engines": {
        "typescriptserver": "^2.6.0"
    }
}

this entry would specify a semver that the typescript server would check against its own version to determine if a plugin can be loaded or not. If a plugin is not compatible, we should generate an error event (see #18849)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions