I was coding on JavaScript when my instructor, Andrew J. Mead (I actually learn JS from Udemy) were telling about try and catch . I type slowly so I often use auto-complete given by VS Code. Anyway, I wrote try and in auto-complete it gave me trycatch . I clicked on it and it gave me this
try {
} catch (error) {
}
I want the error to be e like catch(e) , not catch(error) . Is there any way that I can edit VS Code's auto-complete?
Screenshots given
Thanks recently for the support
You can create custom snippet for VS Code
For do this, you need:
{... "My Try-Catch block": { "prefix": "trycatch", "body": [ "try {", "\t$0", "} catch (e) {", "\t", "}", ], "description": "Paste try-catch with e" } }
Your snippet will be up than standard in autocomplete
Or you can edit default snippets located at:
%localappdata%\Programs\Microsoft VS Code\resources\app\extensions\javascript\snippets
In javascript.code-snippets
file
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.