简体   繁体   English

VScode Intellisense显示的定义不在JSdoc上

[英]VScode Intellisense shows definition that's not on JSdoc

I'm currently making a project with JS and I happened to use the package morgan . 我目前正在使用JS进行项目,而碰巧使用了morgan包。 When using it, the VSCode Intellisense shows a documentation that's not compatible with the JSdoc in the index.js file (the only file regarding code). 使用VSCode Intellisense时,它会在index.js文件(与代码有关的唯一文件)中显示与JSdoc不兼容的文档。

Example of what it looks like: 外观示例:

When searching for that in the files, I stumbled upon it in the README file. 在文件中搜索时,我在自述文件中偶然发现了它。

I've tried to replicate it without success and would like to know how that is done. 我试图复制它而没有成功,并且想知道它是如何完成的。

Obs.: I have not checked other text editors. 观察:我尚未检查其他文本编辑器。 Obs2.: I disabled every extension, so that's certainly not something done by an extension. Obs2:我禁用了每个扩展,因此扩展肯定不能完成此操作。

Thanks in advance! 提前致谢!

Obs.: So, it seems that it's not using the README but rather a TS file downloaded by npm. 观察:因此,似乎不是使用README,而是使用了npm下载的TS文件。 More on the answer below! 更多关于下面的答案!

Okay, after a lot of rumbling around: 好吧,经过一番轰鸣之后:

I tried to change what was written in the README and that didn't change what the Intellisense was showing. 我试图更改自述文件中写的内容,但这并没有更改Intellisense显示的内容。

So I started looking once again and I found at 'USER\\AppData\\Local\\Microsoft\\TypeScript\\2.9\\node_modules\\@types\\morgan" a file index.d.ts which contained the same descriptions that were in the README. When changing it, the description intellisense gave changed! 因此,我再次开始查找,并在“ USER \\ AppData \\ Local \\ Microsoft \\ TypeScript \\ 2.9 \\ node_modules \\ @types \\ morgan”下找到一个文件index.d.ts,其中包含与README中相同的描述。它,对Intellisense的描述已更改!

So, what's that file? 那么,那是什么文件? Apparently it's a file on this repo used to document Typescript projects but seems like it can be used for JS projects too. 显然,这是在文件上这个回购用来记录打字稿项目,但看起来它可用于JS项目了。 Now, when it's that downloaded (I suppose NPM does it) and why VScode uses it instead of the JSdoc are still questions to me. 现在,什么时候下载了(我想是NPM做到了),为什么VScode使用它而不是JSdoc仍然是我的问题。

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

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