简体   繁体   English

哪个 vs 代码扩展允许用户使用提示自动创建 function 参数?

[英]Which vs code extension allows the user to get auto-create for function parameters with hints?

I am looking for a vs code extension that auto creates the parameters for function as showed in the image attached .我正在寻找一个 vs 代码扩展,它自动为 function 创建参数,如附图所示。 Is it part of vscode intellisense?它是 vscode 智能感知的一部分吗? For example when i type event listener i am hoping vscode would autofill parameters with something like addEventListener('type: DOMString', callback: EventListener capture?: boolean)例如,当我键入事件侦听器时,我希望 vscode 会使用 addEventListener('type: DOMString', callback: EventListener capture?: boolean) 之类的内容自动填充参数

At the moment I only get popup hints for vscode when I hover over the code.目前,当我在代码上输入 hover 时,我只会得到 vscode 的弹出提示。

The feature you're describing sounds like it could be the IntelliSense feature in Visual Studio Code.您所描述的功能听起来像是 Visual Studio Code 中的 IntelliSense 功能。 IntelliSense provides intelligent code completions based on the context of your code, and it can include parameter hints, which show the parameters that a function or method accepts when you're calling it. IntelliSense 提供基于代码上下文的智能代码完成,它可以包含参数提示,这些提示显示 function 或方法在您调用它时接受的参数。

In order to get this feature, you need to make sure that you have the correct language extension installed for the programming language you're using.为了获得此功能,您需要确保为您正在使用的编程语言安装了正确的语言扩展。 For example, if you're working with JavaScript, you would want to install the "JavaScript (ES6) code snippets" extension.例如,如果您使用的是 JavaScript,则可能需要安装“JavaScript (ES6) 代码片段”扩展。

You can install the JavaScript (ES6) code snippets extension from the Visual Studio Code marketplace by searching for it in the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on Mac) or by visiting this link: https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets您可以从 Visual Studio Code 市场安装 JavaScript (ES6) 代码片段扩展,方法是在“扩展”视图(Mac 上为 Ctrl+Shift+X 或 Cmd+Shift+X)中搜索它,或访问此链接: https:// marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets

This extension should provide you with the parameter hints when you're typing the event listener and it's method.当您键入事件侦听器及其方法时,此扩展应该为您提供参数提示。

Also, the feature can be improved by the fact that vscode have it's built in Intellisense which is pretty good and along with the above extension can work better to give you the autocomplete options and hints.此外,该功能可以通过 vscode 内置的 Intellisense 来改进,这非常好,并且与上述扩展一起可以更好地为您提供自动完成选项和提示。

Please let me know if this helps or if you have any other question.如果这有帮助或者您有任何其他问题,请告诉我。

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

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