refactor(nvim): use schemastore.nvim for yaml schemas
This commit is contained in:
parent
82d1732d8e
commit
df1e59de2b
@ -33,52 +33,39 @@ local rustopts = {
|
|||||||
-- how to execute terminal commands
|
-- how to execute terminal commands
|
||||||
-- options right now: termopen / quickfix
|
-- options right now: termopen / quickfix
|
||||||
executor = require("rust-tools/executors").termopen,
|
executor = require("rust-tools/executors").termopen,
|
||||||
|
|
||||||
-- callback to execute once rust-analyzer is done initializing the workspace
|
-- callback to execute once rust-analyzer is done initializing the workspace
|
||||||
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
||||||
on_initialized = nil,
|
on_initialized = nil,
|
||||||
|
|
||||||
-- These apply to the default RustSetInlayHints command
|
-- These apply to the default RustSetInlayHints command
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
-- automatically set inlay hints (type hints)
|
-- automatically set inlay hints (type hints)
|
||||||
-- default: true
|
-- default: true
|
||||||
auto = true,
|
auto = true,
|
||||||
|
|
||||||
-- Only show inlay hints for the current line
|
-- Only show inlay hints for the current line
|
||||||
only_current_line = false,
|
only_current_line = false,
|
||||||
|
|
||||||
-- whether to show parameter hints with the inlay hints or not
|
-- whether to show parameter hints with the inlay hints or not
|
||||||
-- default: true
|
-- default: true
|
||||||
show_parameter_hints = true,
|
show_parameter_hints = true,
|
||||||
|
|
||||||
-- prefix for parameter hints
|
-- prefix for parameter hints
|
||||||
-- default: "<-"
|
-- default: "<-"
|
||||||
parameter_hints_prefix = "<- ",
|
parameter_hints_prefix = "<- ",
|
||||||
|
|
||||||
-- prefix for all the other hints (type, chaining)
|
-- prefix for all the other hints (type, chaining)
|
||||||
-- default: "=>"
|
-- default: "=>"
|
||||||
other_hints_prefix = "=> ",
|
other_hints_prefix = "=> ",
|
||||||
|
|
||||||
-- whether to align to the lenght of the longest line in the file
|
-- whether to align to the lenght of the longest line in the file
|
||||||
max_len_align = false,
|
max_len_align = false,
|
||||||
|
|
||||||
-- padding from the left if max_len_align is true
|
-- padding from the left if max_len_align is true
|
||||||
max_len_align_padding = 1,
|
max_len_align_padding = 1,
|
||||||
|
|
||||||
-- whether to align to the extreme right or not
|
-- whether to align to the extreme right or not
|
||||||
right_align = false,
|
right_align = false,
|
||||||
|
|
||||||
-- padding from the right if right_align is true
|
-- padding from the right if right_align is true
|
||||||
right_align_padding = 7,
|
right_align_padding = 7,
|
||||||
|
|
||||||
-- The color of the hints
|
-- The color of the hints
|
||||||
highlight = "Comment",
|
highlight = "Comment",
|
||||||
},
|
},
|
||||||
|
|
||||||
hover_actions = {
|
hover_actions = {
|
||||||
auto_focus = true,
|
auto_focus = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
server = {
|
server = {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
vim.keymap.set("n", "<leader>fr", rust_tools.runnables.runnables, {
|
vim.keymap.set("n", "<leader>fr", rust_tools.runnables.runnables, {
|
||||||
@ -218,33 +205,21 @@ lspconfig.yamlls.setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
yaml = {
|
yaml = {
|
||||||
schemas = {
|
schemas = require("schemastore").yaml.schemas({
|
||||||
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
|
replace = {
|
||||||
["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = {
|
["Azure Pipelines"] = {
|
||||||
|
description = "Azure Pipelines override",
|
||||||
|
fileMatch = {
|
||||||
"/azure-pipeline*.y*l",
|
"/azure-pipeline*.y*l",
|
||||||
"/*.azure*",
|
"/*.azure*",
|
||||||
"Azure-Pipelines/**/*.y*l",
|
"Azure-Pipelines/**/*.y*l",
|
||||||
"Pipelines/*.y*l",
|
"Pipelines/*.y*l",
|
||||||
},
|
},
|
||||||
["https://raw.githubusercontent.com/docker/cli/master/cli/compose/schema/data/config_schema_v3.10.json"] = "/docker-compose.y*l",
|
name = "Azure Pipelines",
|
||||||
["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = "**/.gitlab-ci.yml",
|
url = "https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"
|
||||||
["https://json.schemastore.org/travis.json"] = "/.travis.y*l",
|
|
||||||
["https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-inventory.json"] = {
|
|
||||||
"/inventories/*/*.y*l",
|
|
||||||
"/inventory/*.y*l",
|
|
||||||
},
|
|
||||||
["https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-vars.json"] = {
|
|
||||||
"playbooks/vars/*.y*l",
|
|
||||||
"vars/*.y*l",
|
|
||||||
"defaults/*.y*l",
|
|
||||||
"host_vars/*.y*l",
|
|
||||||
"group_vars/*.y*l",
|
|
||||||
},
|
|
||||||
kubernetes = {
|
|
||||||
"*.k8s",
|
|
||||||
"*.k8s.*",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
capabilities = lsp_capabilities,
|
capabilities = lsp_capabilities,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user