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

JSDoc syntax highlighting/intellisense not working for JSDoc @import

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

还没有人认领这个 Issue。

评估

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

调研方向

首先,在 VS Code 1.98.2 中复现所提供的 JavaScript JSDoc 示例,并比较当前对 @import 和 @typedef 的处理方式。完成标准是:import 类型像其他 JSDoc 声明一样被高亮,并且其花括号内会出现建议;在更改后验证这两种行为。

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

描述

Type: Bug

Type the following into a JavaScript file:

/**
 * @import { JSONRuleDefinition } from "../types.ts";
 * @import { MemberNode } from "@humanwhocodes/momoa";
 * 
 * @typedef {Object} SortOptions
 * @property {boolean} caseSensitive
 * @property {boolean} natural
 * @property {number} minKeys
 * @property {boolean} allowLineSeparatedGroups
 * 
 * @typedef {"sortKeys"} SortKeysMessageIds
 * @typedef {"asc"|"desc"} SortDirection
 * @typedef {[SortDirection, SortOptions]} SortKeysRuleOptions
 * @typedef {JSONRuleDefinition<{ RuleOptions: SortKeysRuleOptions, MessageIds: SortKeysMessageIds }>} SortKeysRuleDefinition
 * @typedef {(a:string,b:string) => boolean} Comparator
 */

Expected: The @import statement to be highlighted similar to @typedef, and also for intellisense to give me suggestions when typing in between the curly braces.

Actual: Everything from the left curly brace to end of line after @import is green (same as any comment), and typing inside the curly braces does not bring up intellisense suggestions.

VS Code version: Code 1.98.2 (ddc367ed5c8936efe395cffeec279b04ffd7db78, 2025-03-12T13:32:45.399Z)
OS version: Windows_NT x64 10.0.26100
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 x 2304)
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) 15.73GB (5.21GB free)
Process Argv --crash-reporter-id 6fc032af-f5bd-4f81-ac94-df9dc8e463fa
Screen Reader no
VM 0%
Extensions (30)
Extension Author (truncated) Version
astro-vscode ast 2.15.4
vscode-tailwindcss bra 0.14.11
vscode-eslint dba 3.0.10
vscode-deno den 3.43.6
EditorConfig Edi 0.17.2
code-runner for 0.12.2
copilot Git 1.293.0
copilot-chat Git 0.25.1
vscode-github-actions git 0.27.1
vscode-pull-request-github Git 0.106.0
vscode-mocha-test-adapter hbe 2.14.1
vscode-test-explorer hbe 2.22.1
dotenv mik 1.0.1
vscode-json5 mrm 1.0.0
vscode-docker ms- 1.29.4
remote-containers ms- 0.401.0
remote-wsl ms- 0.88.5
cpptools ms- 1.23.6
sublime-keybindings ms- 4.1.10
test-adapter-converter ms- 0.2.1
vetur oct 0.37.3
vscode-commons red 0.0.6
vscode-yaml red 1.17.0
rust-analyzer rus 0.3.2353
even-better-toml tam 0.21.2
jest-snapshot-language-support tle 1.1.1
pdf tom 1.2.2
sort-lines Tyr 1.12.0
vscode-mdx uni 1.8.13
markdown-pdf yza 1.5.0
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
5a9hg449:31230677
hdaa2157:31222309
copilot_t_ci:31222730
jda6j935:31233686
cp15370_t:31242499
copilothoveroff:31248523

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