@yaegassy/coc-volar
yaegassyVolar (Fast Vue Language Support) extension for coc.nvim
Published Package Summary
coc-volar
fork from a vuejs/language-tools/extensions/vscode
Vue Language Features (Volar) extension for coc.nvim

Install
:CocInstall @yaegassy/coc-volar
scoped packages
Note
coc-volarversionv0.35.0and later usesvue-language-serverversionv2.x.x. If you havecoc-typescript-vue-plugininstalled, please uninstall it as it will cause conflicts and errors.:CocUninstall @yaegassy/coc-typescript-vue-plugin
- To utilize various language features such as
IntelliSense,Diagnostics, and more in the<script>blocks ofVuefiles, you need to install eithercoc-tsserverorcoc-tsserver-dev.:CocInstall coc-tsserveror:CocInstall coc-tsserver-dev- Note:
coc-volarchecks ifcoc-tsserverorcoc-tsserver-devare installed in the environment when opening aVuefile. If they are installed,coc-volarautomatically startstsserver.
[RECOMMENDED] Additional installation of "watchman"
In the @vue/language-server used by coc-volar, it utilizes the workspace/didChangeWatchedFiles notification to watch files within the project.
In coc.nvim, it is recommended to install watchman in order to utilize this feature.
If you have difficulty installing watchman, you can use coc-volar without watchman, but you may not be able to immediately use volar's IntelliSense with the newly added files.
In this case, please execute the command to restart the language server.
:CocRestart
workspaceFolders
Depending on the project like mono repo or how Vim/Neovim is started, workspaceFolders may not be recognized correctly.
If workspaceFolders are not recognized correctly, the language server may parse unnecessary project folders, etc., slowing down the operation. Or Language Server may not work properly.
The default configuration of coc.nvim resolves to the directory where the .git, .hg, or .projections.json files reside as the workspace root.
coc-volar has also already added vite.config.ts, vite.config.js, vue.config.js or nuxt.config.ts to the extension side to resolve workspace root.
If further customization is needed, set b:coc_root_patterns in ".vimrc/init.vim".
Example:
au FileType vue let b:coc_root_patterns = ['.git', '.env', 'package.json', 'tsconfig.json', 'jsconfig.json', 'vite.config.ts', 'vite.config.js', 'vue.config.js', 'nuxt.config.ts']
For more information, check this coc.nvim's wiki.
iskeyword
If the completion menu disappears when typing -, add the iskeyword setting to .vimrc / init.vim.
autocmd Filetype vue setlocal iskeyword+=-
More features
Other major LSP feature are of course supported as well.
completion, definition, typeDefinition, diagnostics, hover, signatureHelp, references, codeLens, formatting, rename and more...
Thanks
License
MIT
This extension is built with create-coc-extension
- Volar (Fast Vue Language Support) extension for coc.nvim
- onLanguage:vue
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for @yaegassy/coc-volar@0.37.4.
| Command (:CocCommand) | Description |
|---|---|
| volar.action.doctor | Show Doctor info |
| vue.action.restartServer | Restart Vue server |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-vetur extension."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-volar extension."
}Raw JSON Schema
{
"enum": [
"cs",
"de",
"es",
"fr",
"it",
"ja",
"ko",
"en",
"pl",
"pt-br",
"ru",
"tr",
"zh-cn",
"zh-tw"
],
"type": "string",
"default": "en",
"description": "Sets the locale used to report diagnostics message from typescript."
}Raw JSON Schema
{
"type": [
"string",
"null"
],
"default": null,
"description": "Custom path to volar server module, ~ and $HOME can also be used. If there is no setting, the built-in module will be used."
}Raw JSON Schema
{
"enum": [
"off",
"messages",
"verbose"
],
"type": "string",
"scope": "window",
"default": "off",
"description": "Traces the communication between coc.nvim and the language server."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enabled code lens."
}Raw JSON Schema
{
"enum": [
true,
false
],
"type": "boolean",
"default": true,
"description": "Vue language server only handles CSS and HTML language support, and tsserver takes over TS language support via TS plugin.",
"enumDescriptions": [
"Enable TypeScript Plugin/Hybrid Mode.",
"Disable TypeScript Plugin/Hybrid Mode."
]
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Use workspace (project) detected tsLibs in volar. if false, use coc-volar's built-in tsLibs."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable completion from Volar."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable formatting from Volar."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enabled code actions."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable diagnostics from Volar."
}Raw JSON Schema
{
"enum": [
"autoKebab",
"autoPascal",
"kebab",
"pascal"
],
"type": "string",
"default": "autoPascal",
"description": "Preferred tag name case.",
"enumDescriptions": [
"Auto Detect from Content (Fallback to <kebab-case> if detect failed)",
"Auto Detect from Content (Fallback to <PascalCase> if detect failed)",
"<kebab-case>",
"<PascalCase>"
]
}Raw JSON Schema
{
"enum": [
"autoKebab",
"autoCamel",
"kebab",
"camel"
],
"type": "string",
"default": "autoKebab",
"description": "Preferred attr name case.",
"enumDescriptions": [
"Auto Detect from Content (Fallback to :kebab-case=\"...\" if detect failed)",
"Auto Detect from Content (Fallback to :camelCase=\"...\" if detect failed)",
":kebab-case=\"...\"",
":camelCase=\"...\""
]
}Raw JSON Schema
{
"type": [
"number",
"null"
],
"default": null,
"description": "Set --max-old-space-size option on server process. If you have problem on frequently \"Request textDocument/** failed.\" error, try setting higher memory(MB) on it."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show inlay hints for missing required props."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [
"vue"
]
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable/disable scaffold snippets completion. Typing `vue` or `vuedc` will output completion suggestions. This snippets completion feature will only work on the first line of the file."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Auto add `const props = ` before `defineProps` when selecting the completion item `props`. (also `emit` and `slots`)"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show inlay hints for component options wrapper for type support."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show inlay hints for v-bind shorthand."
}Raw JSON Schema
{
"type": "boolean",
"default": false
}Raw JSON Schema
{
"type": "boolean",
"default": false
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show inlay hints for destructured props."
}Raw JSON Schema
{
"type": "boolean",
"default": true
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable the initialization and workdone progress notifications."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show inlay hints for event argument in inline handlers."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Enable fix patch for code action issue #226"
}