This commit is contained in:
2026-05-15 21:10:42 +03:00
parent 15091b4efb
commit 3a0b8f5fc6
7 changed files with 316 additions and 40 deletions

View File

@@ -13,6 +13,21 @@
return {
cmd = { 'svelteserver', '--stdio' },
filetypes = { 'svelte' },
settings = {
typescript = {
inlayHints = {
parameterNames = {
enabled = 'literals',
suppressWhenArgumentMatchesName = true,
},
parameterTypes = { enabled = true },
variableTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
functionLikeReturnTypes = { enabled = true },
enumMemberValues = { enabled = true },
},
},
},
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
-- Svelte LSP only supports file:// schema. https://github.com/sveltejs/language-tools/issues/2777
@@ -32,6 +47,7 @@ return {
group = vim.api.nvim_create_augroup('lspconfig.svelte', {}),
callback = function(ctx)
-- internal API to sync changes that have not yet been saved to the file system
---@diagnostic disable-next-line: param-type-mismatch
client:notify('$/onDidChangeTsOrJsFile', { uri = ctx.match })
end,
})

View File

@@ -40,43 +40,5 @@ return {
php = { 'pint', stop_after_first = true },
typst = { 'typstyle', stop_after_first = true },
},
formatters = {
biome = {
meta = {
url = 'https://github.com/biomejs/biome',
description = 'A toolchain for web projects, aimed to provide functionalities to maintain them.',
},
command = 'biome',
stdin = true,
args = { 'format', '--stdin-file-path', '$FILENAME' },
},
---@type conform.FileFormatterConfig
ruff = {
meta = {
url = 'https://docs.astral.sh/ruff/',
description = 'An extremely fast Python linter, written in Rust. Formatter subcommand.',
},
command = 'ruff',
args = {
'format',
'--force-exclude',
'--stdin-filename',
'$FILENAME',
'-',
},
range_args = function(self, ctx)
return {
'format',
'--force-exclude',
'--range',
string.format('%d:%d-%d:%d', ctx.range.start[1], ctx.range.start[2] + 1, ctx.range['end'][1], ctx.range['end'][2] + 1),
'--stdin-filename',
'$FILENAME',
'-',
}
end,
stdin = true,
},
},
},
}