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

Typescript syntax highlighting: Problem with JSDoc comments with JSON inside `@default` tag

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

还没有人认领这个 Issue。

评估

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

调研方向

使用报告中的 JSDoc 示例复现 TypeScript 语法高亮问题,然后检查用于分类 @default 标签和类似 JSON 的大括号的 grammar 入口点。当 JSON 值中的左大括号被高亮为标签值的一部分而不是代码,并且在 repository 提供相关 grammar 测试时更新了这些测试后,工作就完成了。

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

描述

Type: Bug

When entering a JSON object as the value for a @default tag, the first opening curly bracket is treated as part of the code.

For example:

class X {
  /**
   * @default { "a": 1 }
   */
  foo: any;
}

Is displayed as:
image

VS Code version: Code - Insiders 1.91.0-insider (b36286db80c68b7fdc6bfee2f55e0208c8833dfc, 2024-06-25T09:14:46.370Z)
OS version:
Modes:

System Info: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Extensions (16)

Extension Author (truncated) Version
anycode-c-sharp ms- 0.0.5
anycode-typescript ms- 0.0.5
anycode ms- 0.0.73
anycode-php ms- 0.0.6
anycode-python ms- 0.0.5
anycode-rust ms- 0.0.6
anycode-java ms- 0.0.5
anycode-kotlin ms- 0.0.5
anycode-go ms- 0.0.5
anycode-cpp ms- 0.0.5
remotehub Git 0.63.2024061801
codespaces Git 1.16.23
azure-repos ms- 0.39.2024061901
remote-server ms- 1.6.2024061709
remote-explorer ms- 0.5.2024061309
remote-repositories ms- 0.41.2024022202
主要语言
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 摘要。