microsoft / microsoft/TypeScript-TmLanguage

TypeScript's const modifier on type parameteres breaks syntax highlighting in `.tsx` files

オープン
#979 コメント 0 件 リアクション 6 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
471
フォーク
149
PR マージ指標
30日以内にマージされた PR はありません

説明

Type: Bug

  • Create a file repro.ts.
  • Paste the code below.
  • See that the syntax highlighting works fine.
  • Change the extension to .tsx.
  • See that the syntax highlighting is broken.
export const always = <const T,>(value: T) => {
  return () => value
}

repro.ts:

Screenshot 2023-05-02 at 10 32 21

repro.tsx:

Screenshot 2023-05-02 at 10 32 35

Context: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#const-type-parameters

VS Code version: Code - Insiders 1.78.0-insider (Universal) (e410e7c66e7ce5c6bc31f73150d66857804a0ee9, 2023-04-28T12:31:32.032Z)
OS version: Darwin arm64 22.3.0
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Apple M1 (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 3, 3, 3
Memory (System) 8.00GB (0.13GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
vsc_aacf:30263846
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30618038
pylantcb52:30590116
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
6233i204:30725950
azdwalk:30721579
pythonms35:30671666
03d35959:30680466
24365598:30687740
pythonfmttext:30716741
pythoncmvfstr:30726892
fixshowwlkth:30724385
showsbindicator:30724477
pythongtdpath:30726887

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

まず、提供されたジェネリック関数を .ts ファイルと .tsx ファイルの両方で再現し、次にこのリポジトリにある TypeScript TextMate 文法ファイルを調べます。各拡張子で文法が const 型パラメーターをどのようにトークン化するかを比較します。.tsx の例が .ts 版と一貫した構文ハイライトを受け取れば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

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

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