0.35.5 • Published 7 days ago

@yaegassy/coc-volar v0.35.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 days ago

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-volar version v0.35.0 and later uses vue-language-server version v2.x.x. If you have coc-typescript-vue-plugin installed, 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 of Vue files, you need to install either coc-tsserver or coc-tsserver-dev.
    • :CocInstall coc-tsserver or :CocInstall coc-tsserver-dev
    • Note: coc-volar checks if coc-tsserver or coc-tsserver-dev are installed in the environment when opening a Vue file. If they are installed, coc-volar automatically starts tsserver.
  • If you have a project that previously enabled Takeover mode using the volar.initializeTakeOverMode command in coc-volar, you need to perform the following steps:

    • The file .vim/coc-settings.json should have been created in the project root directory. In that file, the tsserver.enable setting is set to false. Please change it to true.

      .vim/coc-settings.json:

      {
        // ...snip
        //"tsserver.enable": false // <-- Before 
        "tsserver.enable": true // <-- After | Change it to `true`, or delete this line.
      }

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+=-

Configuration options

  • volar.enable: Enable coc-volar extension, default: true
  • volar.useWorkspaceTsdk: Use workspace (project) detected tsLibs in volar. if false, use coc-volar's built-in tsLibs, default: false
  • volar.tsLocale: Sets the locale used to report diagnostics message from typescript, valid option: ["cs", "de", "es", "fr", "it", "ja", "ko", "en", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"], default: "en"
  • volar.autoCreateQuotes: Enable/disable auto creation of quotes for HTML attribute assignment, default: false
  • volar.autoClosingTags: Enable/disable autoClosing of HTML tags, default: false
  • volar.scaffoldSnippets.enable: 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, default: true
  • volar.disableCompletion: Disable completion from Volar, default: false
  • volar.disableDiagnostics: Disable diagnostics from Volar, default: false
  • volar.disableFormatting: Disable formatting from Volar, default: false
  • volar.disableProgressNotifications: Disable the initialization and workdone progress notifications, default: false
  • vue.trace.server: Traces the communication between coc.nvim and the language server, valid option: ["off", "messages", "verbose"], default: "off"
  • vue.server.path: Custom path to volar server module, ~ and $HOME can also be used. If there is no setting, the built-in module will be used, default: null
  • vue.server.maxFileSize: Maximum file size for Vue Language Server to load. (default: 20MB), default: 20971520
  • vue.server.maxOldSpaceSize: 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, default: null
  • vue.codeActions.enabled: Enabled code actions, default: true
  • vue.codeLens.enabled: Enabled code lens, default: true
  • vue.complete.casing.tags: Preferred tag name case, valid options: ["autoKebab", "autoPascal", "kebab", "pascal"], default: "autoPascal"
  • vue.complete.casing.props: Preferred attr name case, valid options: ["autoKebab", "autoCamel", "kebab", "camel"], default: "autoKebab"
  • vue.autoInsert.parentheses: Auto-wrap () to As Expression in interpolations for fix volar-issue #520, default: true
  • vue.autoInsert.dotValue: Auto-complete Ref value with .value, default: false
  • vue.autoInsert.bracketSpacing: Auto add space between double curly brackets: {{|}} -> {{ | }}, default: true
  • vue.inlayHints.missingProps: Show inlay hints for missing required props, false
  • vue.inlayHints.inlineHandlerLeading: Show inlay hints for event argument in inline handlers, default: false
  • vue.inlayHints.optionsWrapper: Show inlay hints for component options wrapper for type support, default: false

Commands

  • vue.action.restartServer: Restart Vue server

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

0.35.5

7 days ago

0.35.4

27 days ago

0.35.3

2 months ago

0.35.2

2 months ago

0.35.1

2 months ago

0.35.0

2 months ago

0.34.23

4 months ago

0.34.22

5 months ago

0.34.21

5 months ago

0.34.20

5 months ago

0.34.10

8 months ago

0.34.11

8 months ago

0.34.18

7 months ago

0.34.19

6 months ago

0.34.16

7 months ago

0.34.17

7 months ago

0.34.14

7 months ago

0.34.15

7 months ago

0.34.12

8 months ago

0.34.13

8 months ago

0.34.6

10 months ago

0.34.5

10 months ago

0.34.4

10 months ago

0.34.9

8 months ago

0.34.8

8 months ago

0.34.7

10 months ago

0.34.3

11 months ago

0.34.2

11 months ago

0.33.7

11 months ago

0.33.6

11 months ago

0.33.5

11 months ago

0.33.4

12 months ago

0.33.3

12 months ago

0.33.2

12 months ago

0.33.1

1 year ago

0.33.0

1 year ago

0.34.1

11 months ago

0.34.0

11 months ago

0.32.4

1 year ago

0.32.3

1 year ago

0.32.2

1 year ago

0.32.1

1 year ago

0.32.0

1 year ago

0.29.0

1 year ago

0.30.2

1 year ago

0.30.1

1 year ago

0.30.0

1 year ago

0.31.4

1 year ago

0.31.3

1 year ago

0.31.2

1 year ago

0.31.1

1 year ago

0.31.0

1 year ago

0.28.11

1 year ago

0.28.10

1 year ago

0.27.2

1 year ago

0.27.1

1 year ago

0.27.0

1 year ago

0.28.1

1 year ago

0.28.0

1 year ago

0.28.9

1 year ago

0.28.8

1 year ago

0.28.7

1 year ago

0.28.6

1 year ago

0.28.5

1 year ago

0.28.4

1 year ago

0.28.3

1 year ago

0.28.2

1 year ago

0.20.1

2 years ago

0.20.0

2 years ago

0.17.2

2 years ago

0.17.3

2 years ago

0.17.4

2 years ago

0.17.5

2 years ago

0.17.6

2 years ago

0.17.7

2 years ago

0.17.8

2 years ago

0.17.9

2 years ago

0.17.0

2 years ago

0.17.1

2 years ago

0.17.10

2 years ago

0.17.11

2 years ago

0.21.8

2 years ago

0.21.7

2 years ago

0.21.6

2 years ago

0.21.5

2 years ago

0.21.4

2 years ago

0.21.3

2 years ago

0.21.2

2 years ago

0.21.1

2 years ago

0.21.0

2 years ago

0.18.1

2 years ago

0.18.0

2 years ago

0.22.3

2 years ago

0.22.2

2 years ago

0.22.1

2 years ago

0.22.0

2 years ago

0.15.0

2 years ago

0.15.1

2 years ago

0.15.2

2 years ago

0.16.3

2 years ago

0.16.4

2 years ago

0.16.5

2 years ago

0.16.6

2 years ago

0.16.7

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.16.2

2 years ago

0.20.8

2 years ago

0.20.7

2 years ago

0.20.6

2 years ago

0.20.5

2 years ago

0.20.4

2 years ago

0.20.3

2 years ago

0.20.2

2 years ago

0.25.18

1 year ago

0.25.19

1 year ago

0.25.14

1 year ago

0.25.15

1 year ago

0.25.16

1 year ago

0.25.17

1 year ago

0.25.10

1 year ago

0.25.11

1 year ago

0.25.12

1 year ago

0.25.13

1 year ago

0.25.4

2 years ago

0.25.3

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago

0.25.9

2 years ago

0.25.8

2 years ago

0.25.7

2 years ago

0.25.6

2 years ago

0.25.5

2 years ago

0.14.0

2 years ago

0.14.1

2 years ago

0.14.2

2 years ago

0.14.3

2 years ago

0.26.3

1 year ago

0.24.10

2 years ago

0.26.2

1 year ago

0.26.1

1 year ago

0.26.0

1 year ago

0.26.6

1 year ago

0.26.5

1 year ago

0.26.4

1 year ago

0.19.0

2 years ago

0.19.1

2 years ago

0.19.2

2 years ago

0.23.3

2 years ago

0.23.2

2 years ago

0.23.1

2 years ago

0.23.0

2 years ago

0.25.25

1 year ago

0.25.21

1 year ago

0.24.5

2 years ago

0.25.22

1 year ago

0.24.4

2 years ago

0.25.23

1 year ago

0.24.3

2 years ago

0.25.24

1 year ago

0.24.2

2 years ago

0.24.1

2 years ago

0.24.0

2 years ago

0.25.20

1 year ago

0.24.9

2 years ago

0.24.8

2 years ago

0.24.7

2 years ago

0.24.6

2 years ago

0.8.4

2 years ago

0.13.0

2 years ago

0.13.1

2 years ago

0.13.2

2 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.0

3 years ago

0.10.1

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.4

2 years ago

0.10.5

2 years ago

0.10.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.6.9

3 years ago

0.6.8

3 years ago

0.11.0

2 years ago

0.6.10

3 years ago

0.9.0

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.12.0

2 years ago

0.12.1

2 years ago

0.12.2

2 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.5.43

3 years ago

0.5.44

3 years ago

0.5.41

3 years ago

0.5.42

3 years ago

0.5.40

3 years ago

0.5.38

3 years ago

0.5.39

3 years ago

0.5.37

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.5

3 years ago

0.6.4

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.36

3 years ago

0.5.35

3 years ago

0.5.34

3 years ago

0.5.32

3 years ago

0.5.33

3 years ago

0.5.30

3 years ago

0.5.31

3 years ago

0.5.29

3 years ago

0.5.28

3 years ago

0.5.27

3 years ago

0.5.25

3 years ago

0.5.26

3 years ago

0.5.24

3 years ago

0.5.22

3 years ago

0.5.23

3 years ago

0.5.18

3 years ago

0.5.19

3 years ago

0.5.16

3 years ago

0.5.17

3 years ago

0.5.15

3 years ago

0.5.21

3 years ago

0.5.20

3 years ago

0.5.14

3 years ago

0.5.11

3 years ago

0.5.12

3 years ago

0.5.13

3 years ago

0.5.10

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.9

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.3.0

3 years ago

0.4.1

3 years ago

0.3.2

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.2.5

3 years ago

0.4.2

3 years ago

0.3.3

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago