简体   繁体   English

Visual Studio代码Intellisense方法定义Javascript

[英]Visual Studio Code Intellisense Method Definitions Javascript

Apparently no one else has wanted this feature, or I'm missing something. 显然没有其他人想要此功能,或者我缺少了一些东西。 Intellisense works as normal, but I'm wondering if I'm missing a setting somewhere, if there is an extension, or if this functionality just isn't offered in VS Code... I would like to have the purpose of the method display when I start typing it as you can see in Adobe Brackets: Intellisense可以正常工作,但是我想知道我是否缺少某个地方的设置,是否有扩展名,或者VS Code中是否未提供此功能...我想知道方法的目的当我开始键入它时显示,如您在Adobe Brackets中看到的那样:

Brackets.io

As opposed to how it shows in VS Code(which just shows the parameter requirements): 与它在VS Code中的显示方式相反(仅显示参数要求): VS代码

Is this possible? 这可能吗?

VSCode is able to use the typescript language server to infer some information about the javascript that you're writing. VSCode能够使用打字机语言服务器来推断一些有关您正在编写的javascript的信息。 The types for window/document etc are provided by the typescript team. 窗口/文档等的类型由打字稿团队提供。

Here's where the type information for elements comes from. 这是元素的类型信息的来源。 Compare that with the types for the document object . 将其与文档对象的类型进行比较。 Notice that the properties here have comments above them, while the element properties do not. 请注意,此处的属性上面有注释,而元素属性则没有。 Type document.getElementById in VSCode, you'll see extra info like you do in brackets: 键入document.getElementById在VSCode,你会看到额外的信息就像你在括号做:

带有intellisense的VSCode屏幕截图

So for this information to appear about properties on Element s, someone would need to go through and add the comments. 因此,要使此信息出现在Element的属性上,就需要有人经过并添加注释。 I have no idea if the typescript team is open to this, though. 不过,我不知道打字稿团队是否对此开放。

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

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