The sample given at for `Writing-a-Language-Service-Plugin` doesn't compile.

オープン
#45,915 コメント 15 件 リアクション 1 件 担当者 1 名 GitHub で見る

@orta がすでに取り組んでいます。

2021年9月16日 から。

評価

この issue はまだ評価されていません。

説明

Docs

Bug Report

🔎 Search Terms

plugin
language-service
compile

  • I was unable to test this on prior versions because there are no earlier versions of the documentation_____
💻 Code

This is copied from the guide at
https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin

  const ts = modules.typescript;

  function create(info: ts.server.PluginCreateInfo) {
    // Set up decorator
    const proxy: ts.LanguageService = Object.create(null);
    for (let k of Object.keys(info.languageService) as Array<
      keyof ts.LanguageService
    >) {
      const x = info.languageService[k];
      proxy[k] = (...args: Array<{}>) => x.apply(info.languageService, args);
    }
    return proxy;
  }

  return { create };
}
🙁 Actual behavior

I am entering the code sample from https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin and I am getting compile errors while setting up the decorator:

image

🙂 Expected behavior

I was hoping I could copy/paste the sample and it would work.

NOTE: It's also possible the documentation around this just needs to be clearer. How do you go about starting the plugin? Do you run yo code? Do you run npm init? Do you just create a single file index.js? I am very unclear how to begin development of this plugin.

主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。