Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Broken syntax highlighting for generic function with optional type in Typescript JSX

未关闭
#967 0 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript, vscode
领域
tooling

调研方向

在新的 .tsx 文件中使用提供的 TypeScript JSX 代码片段来复现高亮问题。然后检查 TypeScript-TmLanguage 语法文件,追踪泛型函数语法是如何分类的。当所示示例在 VS Code 中以正确的高亮显示,且后续的 => token 没有被错误高亮时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Type: Bug

Inside of a new .tsx file, create the following code:

type GenericType<T> = boolean;

const testGeneric = <T = void,>(): GenericType<T> => {
  return true;
};

const testGeneric2 = <T,>(): GenericType<T> => {
  return true;
};

Every => after the <T = void,> will be incorrectly highlighted.

Screenshot 2023-02-24 at 11 37 44 AM

VS Code version: Code 1.75.1 (Universal) (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:34:59.000Z)
OS version: Darwin arm64 22.2.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Apple M1 Pro (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
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.09GB free)
Process Argv --crash-reporter-id b866acdc-8967-448e-b6c1-00876386ce17
Screen Reader no
VM 0%
Extensions (20)
Extension Author (truncated) Version
vscode-tailwindcss bra 0.9.7
vscode-eslint dba 2.4.0
vsc-material-theme-icons equ 2.5.0
prettier-vscode esb 9.10.4
git-graph mhu 1.30.0
theme-monokai-pro-vscode mon 1.2.0
vscode-docker ms- 1.24.0
isort ms- 2022.8.0
python ms- 2023.2.0
vscode-pylance ms- 2023.2.40
jupyter ms- 2023.1.2010391206
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.14
vscode-jupyter-cell-tags ms- 0.1.6
vscode-jupyter-slideshow ms- 0.1.5
code-spell-checker str 2.17.1
vscode-stylelint sty 1.2.4
vscode-icons vsc 12.2.0
gitblame wad 10.1.0
vscode-todo-highlight way 1.0.5

(6 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
vscccc:30610679
pyindex848:30662994
nodejswelcome1:30587005
3biah626:30602489
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
2i9eh265:30646982
funwalk2cf:30671525

主要语言
TypeScript
星标
471
派生
149
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/TypeScript-TmLanguage 的其他 Issue

查看 microsoft/TypeScript-TmLanguage 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。