admin管理员组文章数量:1325380
This is a superset of VSCode add parentheses when autompleting functions
There is a setting in VSCode javascript: plete function calls
that automatically adds in the parentheses and signature when you accept the autoplete suggestion for a javascript function. (The equivalent setting exists for Typescript.)
For example, if you have the function function test(a,b) {return a+b;},
and you type tes
and accept the suggestion, you'll get the full test(a,b)
pleted, not just test
.
However (see gif at bottom for demos),
- it appears not to work in
<script>
tags - it appears not to work for methods, e.g.
document.getElementById()
- it appears not to work for built-ins, like
new Date()
thus restricting its usefulness.
I'm wondering if anyone is aware of a way to extend the autoplete functionality to include these scenarios.
I've opened a Github issue, in case this is a bug, but it's also possible I'm just misunderstand something.
Finally, here's a gif to demo the cases above:
This is all running latest VSCode with no extensions.
This is a superset of VSCode add parentheses when autompleting functions
There is a setting in VSCode javascript: plete function calls
that automatically adds in the parentheses and signature when you accept the autoplete suggestion for a javascript function. (The equivalent setting exists for Typescript.)
For example, if you have the function function test(a,b) {return a+b;},
and you type tes
and accept the suggestion, you'll get the full test(a,b)
pleted, not just test
.
However (see gif at bottom for demos),
- it appears not to work in
<script>
tags - it appears not to work for methods, e.g.
document.getElementById()
- it appears not to work for built-ins, like
new Date()
thus restricting its usefulness.
I'm wondering if anyone is aware of a way to extend the autoplete functionality to include these scenarios.
I've opened a Github issue, in case this is a bug, but it's also possible I'm just misunderstand something. https://github./microsoft/vscode/issues/119035
Finally, here's a gif to demo the cases above: https://gfycat./carefulvibrantblackbuck
This is all running latest VSCode with no extensions.
Share Improve this question edited Mar 17, 2021 at 17:02 ultraGentle asked Mar 17, 2021 at 16:13 ultraGentleultraGentle 6,3472 gold badges26 silver badges58 bronze badges2 Answers
Reset to default 6Ctrl + Shift + P => Settings.json:
"typescript.suggest.pleteFunctionCalls": true,
"javascript.suggest.pleteFunctionCalls": true,
I added these to .vscode/settings.json
and it worked for me:
{
// ...
"typescript.suggest.pleteFunctionCalls": true,
"javascript.suggest.pleteFunctionCalls": true
// ...
}
Type this: await page.getByText('Form Layouts')
. And then press Enter at the hint. DO NOT CLICK on the hints.
本文标签: javascriptVSCode autocomplete function *and method* parentheses (jsts)Stack Overflow
版权声明:本文标题:javascript - VSCode autocomplete function *and method* parentheses (jsts) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742192193a2430419.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论