microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.71k stars 29.45k forks source link

Typescript type hint problem #233150

Open zero9527 opened 2 weeks ago

zero9527 commented 2 weeks ago

Type: Bug

使用一段时间后,鼠标移到变量或者typescript类型上面,会有以下问题:

正常会有浮层提示类型,重启VS Code之后正常,但是使用一段时间之后还会出现

After using it for a while, when you move the mouse over a variable or typescript type, the following problems will occur:

Normally, there will be a floating layer prompt type, it will be normal after restarting VS Code, but it will still appear after using it for a while

Version: 1.96.0-insider (Universal) Commit: 91bf2f3b96a337c05fdd30dbfe609ae780b74706 Date: 2024-11-19T05:04:26.087Z Electron: 32.2.3 ElectronBuildId: 10561341 Chromium: 128.0.6613.186 Node.js: 20.18.0 V8: 12.8.374.38-electron.0 OS: Darwin x64 22.6.0

Image

VS Code version: Code 1.95.1 (65edc4939843c90c34d61f4ce11704f09d3e5cb6, 2024-10-31T05:14:54.222Z) OS version: Darwin x64 22.6.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|4, 3, 2| |Memory (System)|16.00GB (1.19GB free)| |Process Argv|--crash-reporter-id df018b86-dcb3-4093-a0fe-1df1f758d245| |Screen Reader|no| |VM|0%|
Extensions (7) Extension|Author (truncated)|Version ---|---|--- markdown-mermaid|bie|1.26.0 vscode-eslint|dba|3.0.13 prettier-vscode|esb|11.0.0 githd|hui|2.5.3 vscode-language-pack-zh-hans|MS-|1.95.2024103009 volar|Vue|2.1.10 material-theme|zhu|3.17.5
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 vscaat:30438848 c4g48928:30535728 azure-dev_surveyone:30548225 vscrpc:30673769 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 jg8ic977:31013176 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 cf971741:31144450 iacca1:31171482 notype1cf:31157160 5fd0e150:31155592 dwcopilot:31170013 ```
vs-code-engineering[bot] commented 2 weeks ago

感谢您创建此问题!

然而,由于您没有使用英语,我们很难进行处理。如果可能,请您将此问题描述修改为英文。请您直接编辑此问题,不要提交回复或新问题。

请注意,机器翻译服务通常无法处理用于讨论软件问题所需的技术性语言,所以我们推荐您寻找一位熟悉相关技术的人来协助翻译。

如果您无法做到,没有关系。此问题已经被标记为需要翻译,等待社区成员志愿进行翻译。


Thanks for creating this issue!

Unfortunately, as the description is not in English, it's hard for us to work on. If possible, please edit the original issue to be in English.

In our experience, automatic translation services are not able to handle the technical language needed to effectively communicate about software issues, so we recommend finding a human translator who is familiar with our technology to help.

Otherwise, we have marked this as needing translation and a community member may be able to help out.

mjbvz commented 2 weeks ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

zero9527 commented 2 weeks ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

No, i did not install the latest VS Code insiders build, but i will give it a try.

I have tried Troubleshoot issue and the problem, but it only worked after restarting VSCode Image

zero9527 commented 5 days ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

Yes, I tried it today, and the problem still exists. I put the mouse on age, but there is no pop-up prompt for specific error information.

Version: 1.96.0-insider (Universal) Commit: 91bf2f3b96a337c05fdd30dbfe609ae780b74706 Date: 2024-11-19T05:04:26.087Z Electron: 32.2.3 ElectronBuildId: 10561341 Chromium: 128.0.6613.186 Node.js: 20.18.0 V8: 12.8.374.38-electron.0 OS: Darwin x64 22.6.0

Image

mjbvz commented 5 days ago

Please share the code that demonstrates the issue as text so we can easily test this. Thanks

zero9527 commented 23 hours ago

Please share the code that demonstrates the issue as text so we can easily test this. Thanks

In age: '2', when you move the mouse over it, an error message is expected to appear. Generally, it will disappear after a few minutes of writing the code. It is expected that the message will still appear normally.

type foo = { name: string; age: string };
type coo = { age: number; sex: string };

type Merge<T extends object, U extends object> = U & {
  [K in keyof T as K extends keyof U ? never : K]: T[K];
};

type Result2 = Merge<foo, coo>; // expected to be {name: string, age: number, sex: string}

const res: Result2 = {
  name: '',
  age: '2',
  sex: ''
};