Skip to content

Commit

Permalink
neovim: make gopls build flags dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
geodimm committed Aug 2, 2023
1 parent a4c0074 commit 03b2a23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ local lsp_tools = {
-- Define LSP configuration settings for languages
local servers_config = {
gopls = function()
local buildFlags = {}
for w in os.getenv('GOPLS_BUILD_FLAGS'):gmatch('%S+') do
table.insert(buildFlags, w)
end

return {
settings = {
gopls = {
buildFlags = { '-tags=all,test_setup' },
buildFlags = buildFlags,
codelenses = {
tidy = true,
vendor = true,
Expand Down

0 comments on commit 03b2a23

Please sign in to comment.