All Projects → jadestrong → lsp-volar

jadestrong / lsp-volar

Licence: GPL-3.0 license
Language support for Vue3

Programming Languages

emacs lisp
2029 projects

Projects that are alternatives of or similar to lsp-volar

vue3.0-template-admin
本项目基于vue3+ElementPlus+Typescript+Vite搭建一套通用的后台管理模板;并基于常见业务场景,抽象出常见功能组件;包括动态菜单,菜单权限、登录、主题切换、国际化、个人中心、表单页、列表页、复制文本、二维码分享等等
Stars: ✭ 500 (+2400%)
Mutual labels:  vetur, vue3, volar
vue-bootstrap-boilerplate
📦 Vue 2/3, Bootstrap 5, Vuex, Vue-Router, Sass/Scss, ESLint, Axios (switch to vue3 branch)
Stars: ✭ 86 (+330%)
Mutual labels:  vue3, vue3-composition-api
vue3-docs
vue中文社区,vue3 中文文档
Stars: ✭ 180 (+800%)
Mutual labels:  vue3, vue3-composition-api
Vue Admin Beautiful
🚀🚀🚀vue3 admin,vue3.0 admin,vue后台管理,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design,vue-admin-beautiful-pro,vab admin pro,vab admin plus主线版本基于element-plus、element-ui、ant-design-vue三者并行开发维护,同时支持电脑,手机,平板,切换分支查看不同的vue版本,element-plus版本已发布(vue3,vue3.0,vue,vue3.x,vue.js)
Stars: ✭ 10,968 (+54740%)
Mutual labels:  vue3, vue3-composition-api
dotfiles
My dotfiles - Emacs centric OSX Big Sur
Stars: ✭ 29 (+45%)
Mutual labels:  doom-emacs, lsp-mode
taro3-vue3-template
一个基于 Taro3 和 Vue3 框架微信小程序模版。 核心技术采用Taro3、Vue3、TypeScript、NutUi、Vux4/Pinia、VueUse
Stars: ✭ 115 (+475%)
Mutual labels:  vue3, vue3-composition-api
v-bucket
📦 Fast, Simple, and Lightweight State Manager for Vue 3.0 built with composition API, inspired by Vuex.
Stars: ✭ 42 (+110%)
Mutual labels:  vue3, vue3-composition-api
vue-devui-early
Vue3版本的DevUI组件库。本仓库已迁移至:https://github.com/DevCloudFE/vue-devui
Stars: ✭ 39 (+95%)
Mutual labels:  vue3, vue3-composition-api
vuelve
A declarative syntax for the Composition API in Vue 3.
Stars: ✭ 38 (+90%)
Mutual labels:  vue3, vue3-composition-api
vue-admin-better
🚀🚀🚀vue admin,vue3 admin,vue3.0 admin,vue后台管理,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design,vue-admin-beautiful-pro,vab admin pro,vab admin plus,vue admin plus,vue admin pro
Stars: ✭ 12,962 (+64710%)
Mutual labels:  vue3, vue3-composition-api
VueJs-Soft-UI-Dashboard
🍏 This is Soft UI Dashboard in Vue Js.
Stars: ✭ 61 (+205%)
Mutual labels:  vue3
vue-unstated
A tiny state management library for Vue Composition API.
Stars: ✭ 30 (+50%)
Mutual labels:  vue3
admin-next
😇 The next generation of mx-space admin dashboard built with Vue 3 and TypeScript.
Stars: ✭ 71 (+255%)
Mutual labels:  vue3
sonic-client-web
🎉Front end of Sonic cloud real machine testing platform. Sonic云真机测试平台前端。
Stars: ✭ 512 (+2460%)
Mutual labels:  vue3
vue3-charts
Vue3-Charts is an SVG-based charting library that is very easy to use and highly customizable
Stars: ✭ 86 (+330%)
Mutual labels:  vue3
vue-split-carousel
a carousel component for vue, meanwhile display several carousel item
Stars: ✭ 37 (+85%)
Mutual labels:  vue3
vue3-tutorial
Vue3.2、Vite、setup、echarts、composition API
Stars: ✭ 302 (+1410%)
Mutual labels:  vue3
lsp-metals
lsp-mode ❤️ metals
Stars: ✭ 49 (+145%)
Mutual labels:  lsp-mode
vue-qqmap
基于Vue3的腾讯地图地址可视化拾取、描点,路径规划插件
Stars: ✭ 21 (+5%)
Mutual labels:  vue3
vite-svg
Use SVG files as Vue components with Vite
Stars: ✭ 98 (+390%)
Mutual labels:  vue3

lsp-volar

Language support for Vue3

This package has been merged into lsp-mode, so you can use lsp-mode directly. There will only be some experimental updates here. Once stable, they will be submitted to lsp-mode.

Installation

Doom Emacs

in packages.el

(package! lsp-volar :recipe (:host github :repo "jadestrong/lsp-volar"))

in config.el

(use-package! lsp-volar)

straight.el

First, place the following bootstrap code in your init-file:

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

Then install lsp-volar package:

(straight-use-package
 '(lsp-volar :type git :host github :repo "jadestrong/lsp-volar"))

Last use it:

(use-package lsp-volar
  :straight t)

Hacks

If you prompt \u0000 lsp-warn when performing autocomplete in Vue template, you need to use advice-add to override the following function lsp--create-filter-function to filter the special characters. see this issue johnsoncodehk/volar#1118 .

In doom-emacs, you can place this code in your ~/.doom.d/config.el ,otherwise, you need to use advice-add to replace defadvice! .

(defadvice! +lsp--create-filter-function (workspace)
  :override #'lsp--create-filter-function
  (let ((body-received 0)
        leftovers body-length body chunk)
    (lambda (_proc input)
      (setf chunk (if (s-blank? leftovers)
                      input
                    (concat leftovers input)))

      (let (messages)
        (while (not (s-blank? chunk))
          (if (not body-length)
              ;; Read headers
              (if-let ((body-sep-pos (string-match-p "\r\n\r\n" chunk)))
                  ;; We've got all the headers, handle them all at once:
                  (setf body-length (lsp--get-body-length
                                     (mapcar #'lsp--parse-header
                                             (split-string
                                              (substring-no-properties chunk
                                                                       (or (string-match-p "Content-Length" chunk)
                                                                           (error "Unable to find Content-Length header."))
                                                                       body-sep-pos)
                                              "\r\n")))
                        body-received 0
                        leftovers nil
                        chunk (substring-no-properties chunk (+ body-sep-pos 4)))

                ;; Haven't found the end of the headers yet. Save everything
                ;; for when the next chunk arrives and await further input.
                (setf leftovers chunk
                      chunk nil))
            (let* ((chunk-length (string-bytes chunk))
                   (left-to-receive (- body-length body-received))
                   (this-body (if (< left-to-receive chunk-length)
                                  (prog1 (substring-no-properties chunk 0 left-to-receive)
                                    (setf chunk (substring-no-properties chunk left-to-receive)))
                                (prog1 chunk
                                  (setf chunk nil))))
                   (body-bytes (string-bytes this-body)))
              (push this-body body)
              (setf body-received (+ body-received body-bytes))
              (when (>= chunk-length left-to-receive)
                (condition-case err
                    (with-temp-buffer
                      (apply #'insert
                             (nreverse
                              (prog1 body
                                (setf leftovers nil
                                      body-length nil
                                      body-received nil
                                      body nil))))
                      (decode-coding-region (point-min)
                                            (point-max)
                                            'utf-8)
                      (goto-char (point-min))
                      (while (search-forward "\\u0000" nil t)
                        (replace-match "" nil t))
                      (goto-char (point-min))
                      (push (lsp-json-read-buffer) messages))

                  (error
                   (lsp-warn "Failed to parse the following chunk:\n'''\n%s\n'''\nwith message %s"
                             (concat leftovers input)
                             err)))))))
        (mapc (lambda (msg)
                (lsp--parser-on-message msg workspace))
              (nreverse messages))))))

Changelog

  1. In volar 0.30.0 you can skip calculate auto import by set lsp-typescript-suggest-auto-imports to nil to improve the completion speed. Check this issue.

    lsp-typescript-suggest-auto-imports is a setting registed by lsp-vetur.

    This will disable the auto completation of third-party libraries and affect the experience, so you don't have to set it to nil unless you feel that there is a significant performance imporvement after disabling it .

  2. After volar 0.32.1 @volar/server was renamed to @volar/vue-language-server , so you need resintall the new package.

Language Server

  1. M-x lsp-install-server select volar-api or volar-doc or volar-html
  2. Or use npm/yarn , npm install -g @volar/vue-language-server

Customization

lsp-volar

lsp-volar-take-over-mode

It is enabled by default. If you want disable it, add (setq lsp-volar-take-over-mode nil) to your config file. What is Take Over Mode?

lsp-volar-activate-file

If your project don't have a package.json file with vue dependencies in workspace-root, such as a yarn workspace / mono-repo project, you can add a file with a custom name to force enable @volar/server for this project. The default file name is .volarrc. You can specify any file name by modifying the file lsp-volar-activate-file variable.

lsp-volar-completion-tag-casing

Type: (choice (const both) (const kebabCase) (const pascalCase))

Default: both

Casing conversion for tag completion

lsp-volar-completion-attr-casing

Type: (choice (const kebabCase) (const camelCase))

Default: kebabCase

Casing conversion for attr completion.

Reference

  1. Tutorial: nvim-lspconfig - how to set up multiple language servers
  2. I have multiple language servers registered for language FOO. Which one will be used when opening a project?
  3. I have multiple language servers for language FOO and I want to select the server per project, what can I do?
  4. multiple servers
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].