Skip to content

Proper way of patching tsserver? #64

Answered by nonara
NickSeagull asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the kind words, Nick!

The conventional way to go about doing something that alters both compilation and LS behaviour is to write a LS plugin in addition to your transformer.

In v2, I plan to allow bundling LS + transformers into the same package, requiring only a single config line. Unfortunately, it's not ready yet.

You can still accomplish the same, however. The only downside is that you'll need two lines in the config. But, you can have both the LS plugin and any other transformers in the same module, or even the same file, using the import property to specify the correct export.

ie:

{
  "compilerOptions": {
    "plugins": [
      // Assumes programTransformer is an exported…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NickSeagull
Comment options

@nonara
Comment options

Answer selected by nonara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants