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

Typescript syntax highlighting breaks when variable declaration contains line breaks

未关闭
#1,056 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

使用报告中展示的多行 TypeScript 声明,在 VS Code 中重现高亮失败。然后检查 repository 的 TypeScript TextMate 语法文件,并追踪该声明如何跨行进行标记化。以下 for 循环和后续代码保持正确的语法着色,并为此示例添加回归覆盖,即视为完成。

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

描述

Type: Bug

After the following variable declaration (not my fault, Prettier formats it like this) all subsequent code has wrong coloring

let value:
  | {
      x: number
      y: number
    }
  | undefined
for (let i = 0; i < 3; ++i) {
  // ...
}

Image

VS Code version: Code 1.101.2 (2901c5ac6db8a986a5666c3af51ff804d05af0d4, 2025-06-24T20:27:15.391Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 3800X 8-Core Processor (16 x 3893)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 63.95GB (35.23GB free)
Process Argv --crash-reporter-id 8b9e57bc-ac2b-45e6-9844-08b08d97b131
Screen Reader no
VM 0%
Extensions disabled
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
pythonpulldiag:31335739
996jf627:31283433
pythonrdcb7cf:31303019
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
6518g693:31334701
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixt:31329274
9d2cg352:31339597
convertlamdat:31329272
0g0a1943:31338100
i851h500:31338111
usemarketplace:31336439
nesew2to5:31336538
1292j425:31332164
agentclaude:31335815
4f60g487:31327383
nes-diff-11:31337487
onetestforazureexp:31335613
63221493:31336333
yijiwantestdri0626-c:31336931

主要语言
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 摘要。