简体   繁体   English

Svelte with TypeScript:如何让 vscode 也在问题选项卡上显示警告

[英]Svelte with TypeScript: How to make vscode also display warnings on problems tab

I have a Svelte project with TypeScript support created with:我有一个带有 TypeScript 支持的 Svelte 项目:

npx degit sveltejs/template ts-test
cd ts-test
node script/setupTypeScript.js
npm install

and I'm using the Svelte for VS Code extension我正在使用Svelte for VS Code扩展

vscode reports the following warning on mouse hover: vscode 在鼠标 hover 上报告以下警告:

(parameter) filter: any
Parameter 'filter' implicitly has an 'any' type, but a better type may be inferred from usage.ts(7044)

鼠标悬停时会显示错误,但不会显示在问题选项卡上

As you can see, the error is displayed on mouse-hover but not on the problems tab.如您所见,错误显示在鼠标悬停时,而不是问题选项卡上。

This actually the right behavior.这实际上是正确的行为。 This is a hint, only warnings/errors are shown in the Problems tab.这是一个提示,“问题”选项卡中仅显示警告/错误。 You get the same behavior in a normal TypeScript file.您在普通的 TypeScript 文件中得到相同的行为。

VSCode only shows errors/warnings/infos in the Problems tab, there is no option to display hints. VSCode 仅在“问题”选项卡中显示错误/警告/信息,没有显示提示的选项。 The "warning" you talk about is actually a hint, so it's not shown in the Problems tab.您所说的“警告”实际上是一个提示,因此不会显示在“问题”选项卡中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM