Trying to fix ty and ruff conflicts, and added some stuff for golang
This commit is contained in:
parent
5233c6a3d2
commit
c7e0fbb556
38
init.lua
38
init.lua
|
|
@ -690,14 +690,7 @@ require('lazy').setup({
|
|||
bashls = {},
|
||||
jsonls = {},
|
||||
yamlls = {},
|
||||
ty = {
|
||||
configuration = {
|
||||
rules = {
|
||||
['unresolved-reference'] = 'warn',
|
||||
diagnosticMode = 'workspace',
|
||||
},
|
||||
},
|
||||
},
|
||||
ruff = {},
|
||||
-- rust_analyzer = {},
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
|
|
@ -740,7 +733,6 @@ require('lazy').setup({
|
|||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format Lua code
|
||||
'ruff',
|
||||
})
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
|
|
@ -752,7 +744,7 @@ require('lazy').setup({
|
|||
'solargraph',
|
||||
'bashls',
|
||||
'lua_ls',
|
||||
'ty',
|
||||
'ruff',
|
||||
}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
||||
automatic_installation = false,
|
||||
handlers = {
|
||||
|
|
@ -802,14 +794,6 @@ require('lazy').setup({
|
|||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
go = { 'gofmt' },
|
||||
python = {
|
||||
-- To fix auto-fixable lint errors.
|
||||
'ruff_fix',
|
||||
-- To run the Ruff formatter.
|
||||
'ruff_format',
|
||||
-- To organize the imports.
|
||||
'ruff_organize_imports',
|
||||
},
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
-- python = { "isort", "black" },
|
||||
--
|
||||
|
|
@ -997,7 +981,23 @@ require('lazy').setup({
|
|||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'go', 'yaml', 'json' },
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c',
|
||||
'diff',
|
||||
'html',
|
||||
'lua',
|
||||
'luadoc',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'query',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'go',
|
||||
'yaml',
|
||||
'json',
|
||||
'python',
|
||||
},
|
||||
-- Autoinstall languages that are not installed
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
return {
|
||||
{
|
||||
'olexsmir/gopher.nvim',
|
||||
ft = 'go',
|
||||
-- branch = "develop"
|
||||
-- (optional) updates the plugin's dependencies on each update
|
||||
build = function()
|
||||
vim.cmd.GoInstallDeps()
|
||||
end,
|
||||
---@module "gopher"
|
||||
---@type gopher.Config
|
||||
opts = {},
|
||||
config = function()
|
||||
require('gopher').setup {
|
||||
-- log level, you might consider using DEBUG or TRACE for debugging the plugin
|
||||
log_level = vim.log.levels.INFO,
|
||||
|
||||
-- timeout for running internal commands
|
||||
timeout = 2000,
|
||||
|
||||
-- timeout for running installer commands(e.g :GoDepsInstall, :GoDepsInstallSync)
|
||||
installer_timeout = 999999,
|
||||
|
||||
-- user specified paths to binaries
|
||||
commands = {
|
||||
go = 'go',
|
||||
gomodifytags = 'gomodifytags',
|
||||
gotests = 'gotests',
|
||||
impl = 'impl',
|
||||
iferr = 'iferr',
|
||||
},
|
||||
gotests = {
|
||||
-- a default template that gotess will use.
|
||||
-- gotets doesn't have template named `default`, we use it to represent absence of the provided template.
|
||||
template = 'default',
|
||||
|
||||
-- path to a directory containing custom test code templates
|
||||
template_dir = nil,
|
||||
|
||||
-- use named tests(map with test name as key) in table tests(slice of structs by default)
|
||||
named = false,
|
||||
},
|
||||
gotag = {
|
||||
transform = 'snakecase',
|
||||
|
||||
-- default tags to add to struct fields
|
||||
default_tag = 'json',
|
||||
|
||||
-- default tag option added struct fields, set to nil to disable
|
||||
-- e.g: `option = "json=omitempty,xml=omitempty`
|
||||
option = nil,
|
||||
},
|
||||
iferr = {
|
||||
-- choose a custom error message, nil to use default
|
||||
-- e.g: `message = 'fmt.Errorf("failed to %w", err)'`
|
||||
message = nil,
|
||||
},
|
||||
json2go = {
|
||||
-- command used to open interactive input.
|
||||
-- e.g: `split`, `botright split`, `tabnew`
|
||||
interactive_cmd = 'vsplit',
|
||||
|
||||
-- name of autogenerated struct
|
||||
-- e.g: "MySuperCoolName"
|
||||
type_name = nil,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -7,7 +7,6 @@ return {
|
|||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' },
|
||||
python = { 'ruff' },
|
||||
}
|
||||
|
||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||
|
|
|
|||
Loading…
Reference in New Issue