Skip to content

Conditionally use LWC type definitions #602

@wjhsf

Description

@wjhsf

The language server currently copies type definitions from an old version of LWC. This was originally added to facilitate autocompletion in JavaScript projects. However, in modern VS Code, if a project has lwc in its node_modules, then autocompletion is provided out of the box. Any project that has unit tests for components will necessarily have a local copy of lwc, so copying the type definitions is unnecessary.

Additionally, for TypeScript projects, there are significant incompatibilities between the bundled version (v2.37.3) and the latest version (v8.0.0). For a project using the latest version, a user with the VS Code extension installed will need to have experimentalDecorators: true in their tsconfig.json, while a user with a different IDE will need to have experimentalDecorators: false. Since that is not possible, and to remove the need for the language server to keep up with LWC versions, the default behavior should change to using the locally installed version of LWC from a user's project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions