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()
vim.filetype.add({
filename = {
['.dockerignore'] = "dockerignore"
},
pattern = {
[".*%.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
return M

View File

@ -254,23 +254,15 @@ lspconfig.azure_pipelines_ls.setup({
},
},
yaml = {
schemas = require("schemastore").yaml.schemas({
replace = {
["Azure Pipelines"] = {
description = "Azure Pipelines override",
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",
},
schemas = {
["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = {
"*.yml",
"*.yaml",
},
}),
},
},
},
filetypes = "azure-pipelines",
capabilities = lsp_capabilities,
on_attach = on_attach,
})