Skip to content

sublimelsp/LSP-vue

Repository files navigation

LSP-vue

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

Table of Contents

Installation

Note

Make sure that LSP-typescript is installed - it's a required dependency.

Configuration

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

Semantic Tokens

Server assigns a dedicated entity.name.tag.vue scope to component tags which allows one to customize their color. To customize, select UI: Customize Color Scheme from the Command Palette and add a rule like the following (with your chosen color):

{
    // ...
    "rules": [
        // ...
        {
            "scope": "entity.name.tag.vue",
            "foreground": "color(var(blue))",
        },
    ],
}

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:
{
    "show_inlay_hints": true
}
  1. Modify the following settings through Preferences: LSP-vue Settings:
{
  "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+.

About

Vue support for Sublime's LSP plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages