Skip to content

Allow usage of Language Service plugins via tsconfig.json compilerOptions.plugins? #160

Description

@karlhorky

I would like to use typescript-formatter on the command line to call the SQL formatting functionality in typescript-sql-tagged-template-plugin (when SQL is in inline tagged template literals).

The language service plugin implements getFormattingEditsForRange, but it is not being loaded if I specify it in tsconfig.json as follows:

{
  "compilerOptions": {
    "plugins": [
      { "name": "typescript-sql-tagged-template-plugin" }
    ]
  }
}

I'm guessing because TypeScript is being imported from 'typescript', instead of 'typescript/lib/tsserverlibrary', which seems to be required for enabling plugins.

I also found a gist from @weswigham, which seems to go in this direction.

Would this use case be something possible to support here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions