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

LSP-volar

by sublimelsp ST3 Trending

Vue support for Sublime's LSP plugin

Details

Installs

  • Total 2K
  • Win 768
  • Mac 808
  • Linux 495
Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18
Windows 6 13 5 2 5 5 5 3 9 4 2 4 1 2 4 3 4 3 4 6 9 10 4 11 3 4 3 4 0 4 4 5 3 0 0 6 6 1 5 8 4 1 7 6 2 6
Mac 1 3 7 3 4 2 1 2 3 4 3 4 2 2 0 2 3 4 4 4 1 6 6 0 2 0 1 2 1 4 1 4 2 2 1 1 1 4 8 1 1 1 7 2 3 2
Linux 0 1 1 3 2 1 1 6 2 4 2 1 1 2 3 0 2 2 2 3 1 4 1 1 7 1 0 1 0 1 1 1 0 1 0 0 3 3 1 3 2 2 2 1 2 2

Readme

Source
raw.​githubusercontent.​com

LSP-volar

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

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.

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.

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

Vue 2 support

Please see Volar's Installation for setup instructions.