Skip to content

dcermak/salt-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a93c641 · May 23, 2023
Jan 23, 2023
Jun 8, 2021
Nov 9, 2021
Jan 20, 2022
Jun 10, 2021
Jun 17, 2021
Nov 9, 2021
Mar 22, 2021
Jun 17, 2021
Jan 23, 2023
May 23, 2023
Jan 23, 2023
Jun 17, 2021
Jan 23, 2023

Repository files navigation

salt-lsp

Continous Integration VSCode Extension Build Code Coverage Code style: black PyPI Visual Studio Marketplace

Salt Language Server Protocol Server

Prerequisites

  • Python >= 3.8
  • Poetry
  • VSCode (required for live testing the server from an editor)

Server Setup

Install the dependencies:

$ poetry install

Create the completion classes once:

$ poetry run dump_state_name_completions

Start the server:

$ poetry run salt_lsp_server --tcp

Install the server:

$ poetry build
$ pip install --user --force-reinstall dist/salt_lsp-0.0.1*whl

Clients

VSCode

  1. Run yarn install
  2. Start VSCode and open this directory as the server
  3. Open the Debug menu (Ctrl + Shift + D)
  4. Select "Launch Client" drop down
  5. Press F5

Emacs

You should install salt-mode so that sls files are registered to the salt major mode. The language server must be installed on your system so that the clients can launch it.

Using lsp-mode

  1. Install & configure lsp-mode
  2. Load the file clients/emacs/salt-lsp.el
  3. Open a sls file and launch lsp via M-x lsp

Using eglot

  1. Install & configure eglot
  2. Evaluate the following snippet:
(add-to-list 'eglot-server-programs '(salt-mode . ("python3" "-m" "salt_lsp")))
  1. Launch eglot via M-x eglot