Compare commits
No commits in common. "56c6370a730cd3a1690be48eec2219782e9a2d71" and "43d10533ce4ae381901dc9097120f21212106979" have entirely different histories.
56c6370a73
...
43d10533ce
@ -1,6 +1,6 @@
|
|||||||
local prettier = function()
|
local prettier = function()
|
||||||
return {
|
return {
|
||||||
exe = Get_project_node_modules_path() .. "/.bin/prettier",
|
exe = vim.fn.getcwd() .. "/node_modules/.bin/prettier",
|
||||||
args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
|
args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
|
||||||
stdin = true,
|
stdin = true,
|
||||||
}
|
}
|
||||||
@ -22,14 +22,6 @@ local goimports = function()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local rustfmt = function()
|
|
||||||
return {
|
|
||||||
exe = "rustfmt",
|
|
||||||
args = { "--edition", "2021" },
|
|
||||||
stdin = true,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
require("formatter").setup({
|
require("formatter").setup({
|
||||||
log_level = vim.log.levels.INFO,
|
log_level = vim.log.levels.INFO,
|
||||||
filetype = {
|
filetype = {
|
||||||
@ -37,7 +29,6 @@ require("formatter").setup({
|
|||||||
typescript = { prettier },
|
typescript = { prettier },
|
||||||
typescriptreact = { prettier },
|
typescriptreact = { prettier },
|
||||||
go = { goimports },
|
go = { goimports },
|
||||||
rust = { rustfmt },
|
|
||||||
|
|
||||||
-- https://github.com/JohnnyMorganz/StyLua
|
-- https://github.com/JohnnyMorganz/StyLua
|
||||||
-- cargo install stylua --features lua54
|
-- cargo install stylua --features lua54
|
||||||
@ -52,7 +43,7 @@ vim.api.nvim_exec2(
|
|||||||
[[
|
[[
|
||||||
augroup FormatAutogroup
|
augroup FormatAutogroup
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWritePost *.js,*.ts,*.tsx,*.go,*.lua,*.rs silent FormatWrite
|
autocmd BufWritePost *.js,*.ts,*.tsx,*.go,*.lua silent FormatWrite
|
||||||
augroup END
|
augroup END
|
||||||
]],
|
]],
|
||||||
{ output = true }
|
{ output = true }
|
||||||
|
@ -1,16 +1,3 @@
|
|||||||
-- Return the node_modules path for this project. If the project root contains a
|
|
||||||
-- frontend/ directory, assume node_modules lives there.
|
|
||||||
function Get_project_node_modules_path()
|
|
||||||
local root_path = vim.fn.getcwd()
|
|
||||||
local frontend_path = root_path .. "/frontend"
|
|
||||||
local is_frontend = vim.fn.isdirectory(frontend_path) ~= 0
|
|
||||||
local base_path = root_path
|
|
||||||
if is_frontend then
|
|
||||||
base_path = frontend_path
|
|
||||||
end
|
|
||||||
return base_path .. "/node_modules"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Return the project's go module path from go.mod, or an empty string if the file cannot be read.
|
-- Return the project's go module path from go.mod, or an empty string if the file cannot be read.
|
||||||
function Get_project_go_module_path()
|
function Get_project_go_module_path()
|
||||||
local root_path = vim.fn.getcwd()
|
local root_path = vim.fn.getcwd()
|
||||||
|
@ -41,7 +41,7 @@ end
|
|||||||
-- Go
|
-- Go
|
||||||
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = false
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
capabilities.textDocument.completion.completionItem.resolveSupport = {
|
capabilities.textDocument.completion.completionItem.resolveSupport = {
|
||||||
properties = {
|
properties = {
|
||||||
"documentation",
|
"documentation",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user