Tips #53
Replies: 6 comments 7 replies
This comment has been hidden.
This comment has been hidden.
-
Hi, the snippets template link isn't available anymore. The new one: https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/templates/vue.code-snippets |
Beta Was this translation helpful? Give feedback.
-
does volar have a shortcut to scaffold the boiler plate code |
Beta Was this translation helpful? Give feedback.
-
Where can I find supported settings? |
Beta Was this translation helpful? Give feedback.
-
Could we maybe add #3397 to the above list? Creating files named "X.vue.js" breaks Volar due to the way it works. My proposal: Title: Don't create files named Description: When creating a vue sfc, volar parses it, and convert it to a js/ts file, and write to a virtual file |
Beta Was this translation helpful? Give feedback.
-
Closed due to outdated content. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here are some not obvious things... keeping update.
Formatting tab size config & Change formatter
Volar formatter respect VSCode tab size config, you can customize formatting tab size and use tabs/spaces. See https://code.visualstudio.com/docs/editor/codebasics#_indentation
If Volar formatter is not good for you, you can also change to other formatter extensions like Prettier.
Step:
Format Document With...
command on a vue file.Configure Default Formatter....
.Renaming
props, components, style class names renaming is working for
<template>
usings, and will retain the format same with before rename.For example:
When you renaming
MyComponent
toOtherComponent
, we will have:Instead of `tsc --noEmit`
In VSCode, you can use
Volar: Verify All Scripts
command to simulationtsc --noEmit
for Vue scripts.In command line, you can use vue-tsc.
Instead of other extensions
Auto rename tag
Make sure enabled
"editor.linkedEditing": true
.Auto close tag
Make sure enabled
"html.autoClosingTags": true
.Jump to tag
Volar supported VSCode Navigation, so you can use VSCode Go to Symbol feature.
Instead of `@typescript-eslint/no-unused-vars`
@typescript-eslint/no-unused-vars
is not support<script setup>
temporarily, but you can use tsconfignoUnusedLocals: true
as a replacement.Asset path resolve
Volar supports asset relative path resolve.
Absolute path resolve based on the tsconfig
paths
option.Instead of `shims-vue.d.ts`
TS Plugin is supported in 0.20.9, you have to useVolar: Switch TS Plugin
command to enable it.Use TypeScript Vue Plugin or Take Over Mode.
Snippets
Volar do no includes snippets, but you can install https://marketplace.visualstudio.com/items?itemName=matijao.vue-nuxt-snippets or create
.vscode/vue.code-snippets
to make your own workspace snippets.Beta Was this translation helpful? Give feedback.
All reactions