From d2758bf44d2a5553c5385d21392c49b9758ea507 Mon Sep 17 00:00:00 2001 From: treatybreaker Date: Sun, 5 Mar 2023 06:12:06 -0600 Subject: feat: add azure pipelines lsp (#2493) * feat: add azure pipelines language server * refactor: rename azure_pipelines_language_server to azure_pipelines_ls * refactor: set azure_pipelines_ls root to search azure-pipelines.yml * docs: correct mistake in azure pipelines ls server.js path --- .../server_configurations/azure_pipelines_ls.lua | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lua/lspconfig/server_configurations/azure_pipelines_ls.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/azure_pipelines_ls.lua b/lua/lspconfig/server_configurations/azure_pipelines_ls.lua new file mode 100644 index 00000000..38d2c6a4 --- /dev/null +++ b/lua/lspconfig/server_configurations/azure_pipelines_ls.lua @@ -0,0 +1,53 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = {}, + filetypes = { 'yaml' }, + root_dir = util.root_pattern 'azure-pipelines.yml', + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/microsoft/azure-pipelines-language-server + +An Azure Pipelines language server + +**By default, `azure-pipelines-ls` doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +`azure-pipelines-ls` can be installed via `npm`: + +```sh +npm install -g azure-pipelines-language-server +``` + +Once installed, point `cmd` to `server.js` inside the `out` directory: + +```lua +cmd = {'node', '/out/server.js', '--stdio'} +``` + +By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so: +```lua +require("lspconfig").azure_pipelines_ls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = { + "/azure-pipeline*.y*l", + "/*.azure*", + "Azure-Pipelines/**/*.y*l", + "Pipelines/*.y*l", + }, + }, + }, + }, +} +``` +The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`. +]], + }, +} -- cgit v1.2.3-70-g09d2