Compare commits

..

No commits in common. "56c6370a730cd3a1690be48eec2219782e9a2d71" and "43d10533ce4ae381901dc9097120f21212106979" have entirely different histories.

3 changed files with 3 additions and 25 deletions

View File

@ -1,6 +1,6 @@
local prettier = function()
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" },
stdin = true,
}
@ -22,14 +22,6 @@ local goimports = function()
}
end
local rustfmt = function()
return {
exe = "rustfmt",
args = { "--edition", "2021" },
stdin = true,
}
end
require("formatter").setup({
log_level = vim.log.levels.INFO,
filetype = {
@ -37,7 +29,6 @@ require("formatter").setup({
typescript = { prettier },
typescriptreact = { prettier },
go = { goimports },
rust = { rustfmt },
-- https://github.com/JohnnyMorganz/StyLua
-- cargo install stylua --features lua54
@ -52,7 +43,7 @@ vim.api.nvim_exec2(
[[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.js,*.ts,*.tsx,*.go,*.lua,*.rs silent FormatWrite
autocmd BufWritePost *.js,*.ts,*.tsx,*.go,*.lua silent FormatWrite
augroup END
]],
{ output = true }

View File

@ -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.
function Get_project_go_module_path()
local root_path = vim.fn.getcwd()

View File

@ -41,7 +41,7 @@ end
-- Go
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 = {
properties = {
"documentation",