feat(nvim): better attach azure pipelines ls for azure pipeline files

This commit is contained in:
Price Hiller 2023-05-22 17:54:53 -05:00
parent da961e5808
commit dc77098877
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
3 changed files with 18 additions and 15 deletions

View File

@ -0,0 +1,4 @@
local opt_local = vim.opt_local
opt_local.tabstop = 2
opt_local.shiftwidth = 2

View File

@ -2,11 +2,18 @@ local M = {}
M.setup = function() M.setup = function()
vim.filetype.add({ vim.filetype.add({
filename = {
['.dockerignore'] = "dockerignore"
},
pattern = { pattern = {
[".*%.dockerfile"] = "dockerfile", [".*%.dockerfile"] = "dockerfile",
[".*%.dockerignore"] = "gitignore", [".*/Azure%-Pipelines/.*%.yml"] = "azure-pipelines",
[".*/Azure%-Pipelines/.*%.yaml"] = "azure-pipelines",
}, },
}) })
vim.treesitter.language.register("yaml", "azure-pipelines")
vim.treesitter.language.register("gitignore", "dockerignore")
end end
return M return M

View File

@ -254,23 +254,15 @@ lspconfig.azure_pipelines_ls.setup({
}, },
}, },
yaml = { yaml = {
schemas = require("schemastore").yaml.schemas({ schemas = {
replace = { ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = {
["Azure Pipelines"] = { "*.yml",
description = "Azure Pipelines override", "*.yaml",
fileMatch = {
"/azure-pipeline*.y*l",
"/*.azure*",
"Azure-Pipelines/**/*.y*l",
"Pipelines/*.y*l",
},
name = "Azure Pipelines",
url = "https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json",
},
}, },
}), },
}, },
}, },
filetypes = "azure-pipelines",
capabilities = lsp_capabilities, capabilities = lsp_capabilities,
on_attach = on_attach, on_attach = on_attach,
}) })