ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-volar

by sublimelsp ST3

Vue support for Sublime's LSP plugin

Details

  • 3.0.0
    2.6.3
  • github.​com
  • github.​com
  • 6 months ago
  • 1 hour ago
  • 4 years ago

Installs

  • Total 7K
  • Win 3K
  • Mac 2K
  • Linux 2K
May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31
Windows 0 1 2 0 0 0 0 1 0 1 0 3 4 2 1 1 0 3 0 0 1 0 2 1 2 1 1 1 2 1 0 1 1 0 0 2 0 3 2 0 2 0 2 3 0 2
Mac 0 0 0 0 0 1 2 1 1 2 1 0 0 1 1 0 2 1 1 0 1 1 0 1 1 0 0 2 0 0 1 0 2 0 1 1 2 1 1 0 0 1 3 0 0 2
Linux 1 1 1 0 0 4 0 1 2 2 1 0 1 1 1 0 0 2 0 0 1 0 1 0 1 0 0 0 0 1 1 0 0 2 1 2 0 2 0 0 0 1 0 0 1 2
0246May 15May 12May 9May 6May 3Apr 30Apr 27Apr 24Apr 21Apr 18Apr 15Apr 12Apr 9Apr 6Apr 3Mar 31May 15 Linux: 1 Mac: 0 Windows: 0May 14 Linux: 1 Mac: 0 Windows: 1May 13 Linux: 1 Mac: 0 Windows: 2May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 4 Mac: 1 Windows: 0May 9 Linux: 0 Mac: 2 Windows: 0May 8 Linux: 1 Mac: 1 Windows: 1May 7 Linux: 2 Mac: 1 Windows: 0May 6 Linux: 2 Mac: 2 Windows: 1May 5 Linux: 1 Mac: 1 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 3May 3 Linux: 1 Mac: 0 Windows: 4May 2 Linux: 1 Mac: 1 Windows: 2May 1 Linux: 1 Mac: 1 Windows: 1Apr 30 Linux: 0 Mac: 0 Windows: 1Apr 29 Linux: 0 Mac: 2 Windows: 0Apr 28 Linux: 2 Mac: 1 Windows: 3Apr 27 Linux: 0 Mac: 1 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 1 Mac: 1 Windows: 1Apr 24 Linux: 0 Mac: 1 Windows: 0Apr 23 Linux: 1 Mac: 0 Windows: 2Apr 22 Linux: 0 Mac: 1 Windows: 1Apr 21 Linux: 1 Mac: 1 Windows: 2Apr 20 Linux: 0 Mac: 0 Windows: 1Apr 19 Linux: 0 Mac: 0 Windows: 1Apr 18 Linux: 0 Mac: 2 Windows: 1Apr 17 Linux: 0 Mac: 0 Windows: 2Apr 16 Linux: 1 Mac: 0 Windows: 1Apr 15 Linux: 1 Mac: 1 Windows: 0Apr 14 Linux: 0 Mac: 0 Windows: 1Apr 13 Linux: 0 Mac: 2 Windows: 1Apr 12 Linux: 2 Mac: 0 Windows: 0Apr 11 Linux: 1 Mac: 1 Windows: 0Apr 10 Linux: 2 Mac: 1 Windows: 2Apr 9 Linux: 0 Mac: 2 Windows: 0Apr 8 Linux: 2 Mac: 1 Windows: 3Apr 7 Linux: 0 Mac: 1 Windows: 2Apr 6 Linux: 0 Mac: 0 Windows: 0Apr 5 Linux: 0 Mac: 0 Windows: 2Apr 4 Linux: 1 Mac: 1 Windows: 0Apr 3 Linux: 0 Mac: 3 Windows: 2Apr 2 Linux: 0 Mac: 0 Windows: 3Apr 1 Linux: 1 Mac: 0 Windows: 0Mar 31 Linux: 2 Mac: 2 Windows: 2May 15 Linux: 1 Mac: 0 Windows: 0May 14 Linux: 1 Mac: 0 Windows: 1May 13 Linux: 1 Mac: 0 Windows: 2May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 4 Mac: 1 Windows: 0May 9 Linux: 0 Mac: 2 Windows: 0May 8 Linux: 1 Mac: 1 Windows: 1May 7 Linux: 2 Mac: 1 Windows: 0May 6 Linux: 2 Mac: 2 Windows: 1May 5 Linux: 1 Mac: 1 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 3May 3 Linux: 1 Mac: 0 Windows: 4May 2 Linux: 1 Mac: 1 Windows: 2May 1 Linux: 1 Mac: 1 Windows: 1Apr 30 Linux: 0 Mac: 0 Windows: 1Apr 29 Linux: 0 Mac: 2 Windows: 0Apr 28 Linux: 2 Mac: 1 Windows: 3Apr 27 Linux: 0 Mac: 1 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 1 Mac: 1 Windows: 1Apr 24 Linux: 0 Mac: 1 Windows: 0Apr 23 Linux: 1 Mac: 0 Windows: 2Apr 22 Linux: 0 Mac: 1 Windows: 1Apr 21 Linux: 1 Mac: 1 Windows: 2Apr 20 Linux: 0 Mac: 0 Windows: 1Apr 19 Linux: 0 Mac: 0 Windows: 1Apr 18 Linux: 0 Mac: 2 Windows: 1Apr 17 Linux: 0 Mac: 0 Windows: 2Apr 16 Linux: 1 Mac: 0 Windows: 1Apr 15 Linux: 1 Mac: 1 Windows: 0Apr 14 Linux: 0 Mac: 0 Windows: 1Apr 13 Linux: 0 Mac: 2 Windows: 1Apr 12 Linux: 2 Mac: 0 Windows: 0Apr 11 Linux: 1 Mac: 1 Windows: 0Apr 10 Linux: 2 Mac: 1 Windows: 2Apr 9 Linux: 0 Mac: 2 Windows: 0Apr 8 Linux: 2 Mac: 1 Windows: 3Apr 7 Linux: 0 Mac: 1 Windows: 2Apr 6 Linux: 0 Mac: 0 Windows: 0Apr 5 Linux: 0 Mac: 0 Windows: 2Apr 4 Linux: 1 Mac: 1 Windows: 0Apr 3 Linux: 0 Mac: 3 Windows: 2Apr 2 Linux: 0 Mac: 0 Windows: 3Apr 1 Linux: 1 Mac: 0 Windows: 0Mar 31 Linux: 2 Mac: 2 Windows: 2May 15 Linux: 1 Mac: 0 Windows: 0May 14 Linux: 1 Mac: 0 Windows: 1May 13 Linux: 1 Mac: 0 Windows: 2May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 4 Mac: 1 Windows: 0May 9 Linux: 0 Mac: 2 Windows: 0May 8 Linux: 1 Mac: 1 Windows: 1May 7 Linux: 2 Mac: 1 Windows: 0May 6 Linux: 2 Mac: 2 Windows: 1May 5 Linux: 1 Mac: 1 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 3May 3 Linux: 1 Mac: 0 Windows: 4May 2 Linux: 1 Mac: 1 Windows: 2May 1 Linux: 1 Mac: 1 Windows: 1Apr 30 Linux: 0 Mac: 0 Windows: 1Apr 29 Linux: 0 Mac: 2 Windows: 0Apr 28 Linux: 2 Mac: 1 Windows: 3Apr 27 Linux: 0 Mac: 1 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 1 Mac: 1 Windows: 1Apr 24 Linux: 0 Mac: 1 Windows: 0Apr 23 Linux: 1 Mac: 0 Windows: 2Apr 22 Linux: 0 Mac: 1 Windows: 1Apr 21 Linux: 1 Mac: 1 Windows: 2Apr 20 Linux: 0 Mac: 0 Windows: 1Apr 19 Linux: 0 Mac: 0 Windows: 1Apr 18 Linux: 0 Mac: 2 Windows: 1Apr 17 Linux: 0 Mac: 0 Windows: 2Apr 16 Linux: 1 Mac: 0 Windows: 1Apr 15 Linux: 1 Mac: 1 Windows: 0Apr 14 Linux: 0 Mac: 0 Windows: 1Apr 13 Linux: 0 Mac: 2 Windows: 1Apr 12 Linux: 2 Mac: 0 Windows: 0Apr 11 Linux: 1 Mac: 1 Windows: 0Apr 10 Linux: 2 Mac: 1 Windows: 2Apr 9 Linux: 0 Mac: 2 Windows: 0Apr 8 Linux: 2 Mac: 1 Windows: 3Apr 7 Linux: 0 Mac: 1 Windows: 2Apr 6 Linux: 0 Mac: 0 Windows: 0Apr 5 Linux: 0 Mac: 0 Windows: 2Apr 4 Linux: 1 Mac: 1 Windows: 0Apr 3 Linux: 0 Mac: 3 Windows: 2Apr 2 Linux: 0 Mac: 0 Windows: 3Apr 1 Linux: 1 Mac: 0 Windows: 0Mar 31 Linux: 2 Mac: 2 Windows: 2

Readme

Source
raw.​githubusercontent.​com

LSP-volar

This is a helper package that automatically installs and updates the Volar Language Server for you.

Warning This package integrates with the legacy 1.x version of the Vue Language Features (formerly Volar). To use the latest version of Vue Language Features migrate to LSP-vue.

Table of Contents

Installation

Configuration

Open the configuration file using Command Palette with Preferences: LSP-volar Settings command or opening it from the Sublime menu (Preferences > Package Settings > LSP > Servers > LSP-volar).

Enable for non-Vue files

Allow LSP-volar to start in *.ts | *.tsx | *.js | *.jsx files.

Warning Don't use this unless you really have a specific reason. It provides worse experience than LSP-typescript in .js/.ts files due to not receiving diagnostic updates on modifying related files. Also it's missing some features of LSP-typescript. See related issue: https://github.com/vuejs/language-tools/issues/3229

Per project:

Create a sublime project file with the following contents:

{
    "folders":
    [
        {
            "path": "."
        }
    ],
    "settings": {
        "LSP": {
            "LSP-volar": {
                "selector": "text.html.vue | source.ts | source.tsx | source.js | source.jsx"
            },
            "LSP-typescript": {
                "enabled": false
            }
        }
    }
}

Globally:

From the Command Palette select Preferences: LSP-volar Settings and paste the following:

// Settings in here override those in "LSP-volar/LSP-volar.sublime-settings"

{
    "selector": "text.html.vue | source.ts | source.tsx | source.js | source.jsx"
}

NOTE: When enabling LSP-volar for non-Vue files, it is advisable to disable the LSP-typescript package to avoid showing duplicate results.

Commands

Package provides a few commands in the Command Palette that can be useful for debugging Volar issues.

LSP-volar (Debug): Show Virtual Files

Shows a tree view of all internal virtual files associated with the currently opened vue file and allows for seeing their contents.

LSP-volar (Debug): Write Virtual Files

Writes all internal virtual files to disk. The files will be created alongside the original vue files that Volar has loaded internally. This can also include vue files within node_modules. Those files can be useful in figuring out why there are type issues in vue files that maybe are due to a Volar bug.

Note Type-checking those genearated .ts files using LSP-typescript is not equivalent to what LSP-volar does as Volar does some internal Vue type augmentations that LSP-typescript does not do. To get a more relevant type checking when inspecting those files it's recommended to disable LSP-typescript and enable LSP-volar for TS files instead. Check Enable for non-Vue files section.

Note If there are many vue files in the project then a lot of files can be created by this command and those could be a bit tiresome to clean up later. In a git-tracked project you might want to use git clean -fx to remove all untracked files. Just make sure you don't have any useful untracked files.

Inlay hints

Inlay hints are short textual annotations that show parameter names, type hints.

inlay-hints

To enable inlay hints: 1. Open the command palette and select Preferences: LSP Settings, then enable show_inlay_hints: “js { "show_inlay_hints”: true }

2. Modify the following settings through `Preferences: LSP-volar Settings`:

```js
{
  "settings": {
    // javascript inlay hints options.
    "javascript.inlayHints.enumMemberValues.enabled": false,
    "javascript.inlayHints.functionLikeReturnTypes.enabled": false,
    "javascript.inlayHints.parameterNames.enabled": "none",
    "javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": false,
    "javascript.inlayHints.parameterTypes.enabled": false,
    "javascript.inlayHints.propertyDeclarationTypes.enabled": false,
    "javascript.inlayHints.variableTypes.enabled": false,
    // typescript inlay hints options.
    "typescript.inlayHints.enumMemberValues.enabled": false,
    "typescript.inlayHints.functionLikeReturnTypes.enabled": false,
    "typescript.inlayHints.parameterNames.enabled": "none",
    "typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": false,
    "typescript.inlayHints.parameterTypes.enabled": false,
    "typescript.inlayHints.propertyDeclarationTypes.enabled": false,
    "typescript.inlayHints.variableTypes.enabled": false,
  }
}

NOTE: Inlay hints require TypeScript 4.4+.