Comments (8)
Correct, if you set disable_defaults = true,
it will reset all fields in the config to lua empty value. which means you have to set your go
binary.
from go.nvim.
Could you send me you config and what OS you are using?
Also is the issue reproducible with https://github.com/ray-x/go.nvim/blob/master/playground/init_lazy.lua
from go.nvim.
OS:
Linux x1carbon 6.8.11-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 27 14:53:33 UTC 2024 x86_64 GNU/Linux
i use default configs for AstroNvim by community
https://github.com/AstroNvim/astrocommunity/blob/main/lua/astrocommunity/pack/go/init.lua
{
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
---@diagnostic disable-next-line: missing-fields
config = {
gopls = {
settings = {
gopls = {
analyses = {
ST1003 = true,
fieldalignment = false,
fillreturns = true,
nilness = true,
nonewvars = true,
shadow = true,
undeclaredname = true,
unreachable = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
codelenses = {
gc_details = true, -- Show a code lens toggling the display of gc's choices.
generate = true, -- show the `go generate` lens.
regenerate_cgo = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
buildFlags = { "-tags", "integration" },
completeUnimported = true,
diagnosticsDelay = "500ms",
matcher = "Fuzzy",
semanticTokens = true,
staticcheck = true,
symbolMatcher = "fuzzy",
usePlaceholders = true,
},
},
},
},
},
},
-- Golang support
{
"nvim-treesitter/nvim-treesitter",
optional = true,
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed =
require("astrocore").list_insert_unique(opts.ensure_installed, { "go", "gomod", "gosum", "gowork" })
end
end,
},
{
"jay-babu/mason-null-ls.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "gomodifytags", "gofumpt", "iferr", "impl", "goimports" }
)
end,
},
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "gopls" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "delve", "gopls", "gomodifytags", "gofumpt", "iferr", "impl", "goimports" }
)
end,
},
{
"leoluz/nvim-dap-go",
ft = "go",
dependencies = {
"mfussenegger/nvim-dap",
{
"jay-babu/mason-nvim-dap.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "delve" })
end,
},
},
opts = {},
},
{
"ray-x/go.nvim",
dependencies = {
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
opts = {
disable_defaults = true,
diagnostic = false,
},
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
-- Prevents Neovim from freezing on plugin installation/update.
-- See: <https://github.com/ray-x/go.nvim/issues/433>
build = function() require("go.install").update_all() end,
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = { "nvim-neotest/neotest-go" },
opts = function(_, opts)
if not opts.adapters then opts.adapters = {} end
table.insert(opts.adapters, require "neotest-go"(require("astrocore").plugin_opts "neotest-go"))
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
go = { "goimports", "gofumpt" },
},
},
},
}
full installed packages list
-- AstroCommunity: import any community modules here
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
-- This guarantees that the specs are processed before any user plugins.
---@type LazySpec
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.colorscheme.catppuccin" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.html-css" },
{ import = "astrocommunity.pack.tailwindcss" },
{ import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.pack.go" },
{ import = "astrocommunity.test.neotest" },
{ import = "astrocommunity.editing-support.multicursors-nvim" },
{ import = "astrocommunity.motion.nvim-surround" },
{ import = "astrocommunity.utility.noice-nvim" },
-- import/override with your plugins folder
}
Also is the issue reproducible with https://github.com/ray-x/go.nvim/blob/master/playground/init_lazy.lua
Yes
{
'ray-x/go.nvim',
dev = (plugin_folder() ~= ''),
-- dev = true,
ft = { 'go', 'gomod', 'gosum', 'gotmpl', 'gohtmltmpl', 'gotexttmpl' },
dependencies = {
'mfussenegger/nvim-dap', -- Debug Adapter Protocol
'rcarriga/nvim-dap-ui',
'nvim-neotest/nvim-nio',
'theHamsta/nvim-dap-virtual-text',
'ray-x/guihua.lua',
},
config = true,
opts = {
disable_defaults = true,
diagnostic = false,
},
}
You have little type in README.md for playground
cd sampleApp
nvim -u ../init.lua main.go
should be
cd sampleApp
nvim -u ../init_lazy.lua main.go
from go.nvim.
Just confirmed the current master branch that GoRun
is not working as expected as go run .
NVIM:
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.10.0/share/nvim"
OS:
Darwin Kernel Version 23.5.0: Wed May 1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64
Recorded reproduce: https://asciinema.org/a/0FSxT7cDsE4vbInwD6RoJLOVv
Fixed playground README: #478
from go.nvim.
@zdk i have problem with this config
{
"ray-x/go.nvim",
dependencies = {
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
opts = {
disable_defaults = true,
diagnostic = false,
},
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
-- Prevents Neovim from freezing on plugin installation/update.
-- See: <https://github.com/ray-x/go.nvim/issues/433>
build = function() require("go.install").update_all() end,
},
try remove
opts = {
disable_defaults = true,
diagnostic = false,
},
for me it's work
from go.nvim.
@zdk i have problem with this config
{ "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua", "neovim/nvim-lspconfig", "nvim-treesitter/nvim-treesitter", }, opts = { disable_defaults = true, diagnostic = false, }, event = { "CmdlineEnter" }, ft = { "go", "gomod" }, -- Prevents Neovim from freezing on plugin installation/update. -- See: <https://github.com/ray-x/go.nvim/issues/433> build = function() require("go.install").update_all() end, },
try remove
opts = { disable_defaults = true, diagnostic = false, },
for me it's work
Just tried removing this two options in the config. Does not seem to work for me.
from go.nvim.
@zdk try add init config line, i forget to add this.
config = function() require("go").setup() end,
full config
{
"ray-x/go.nvim",
dependencies = {
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function() require("go").setup() end,
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
-- Prevents Neovim from freezing on plugin installation/update.
-- See: <https://github.com/ray-x/go.nvim/issues/433>
build = function() require("go.install").update_all() end,
},
from go.nvim.
@nfort Thanks, adding config = function() require("go").setup() end,
seems working fine!!
Also, I have tried adding go="go"
in opts
(without having config = function() require("go").setup() end,
)
opts = {
go = "go",
disable_defaults = true,
diagnostics = false,
},
This also seems works... 🤔
Anyway, thank you again!!
from go.nvim.
Related Issues (20)
- vim shows import error until re-open HOT 2
- How to get highlights and injections to work with go-templates
- New? enable: expected boolean, got number HOT 2
- Provide a way to run alternate command for eg. go and go test HOT 2
- Error from InsertLeave Autocmd, codelens not supported
- 'Buffer file://<filepath> newer than edits.' when importing things on neovim nightly (0.11.0) HOT 2
- How to avoid conflict with navigator HOT 3
- help finding autocomplete bug: extmark/helper text persists. HOT 3
- [question] How to make go.nvim to pick up just installed module? HOT 4
- Bug: GoRename does not work consistently HOT 8
- Doc: contradicting behavior for `:GoBuild` command
- Bug: `:GoBuild` tab completion does not work in module-aware projects HOT 1
- How to add -gcflags="all=-N -l" in GoTest or GoTestFunc HOT 2
- Docker delve support
- feature request: hide "obvious" inlay hints
- bug?: duplicate lint diagnostics
- question: how to disable golangci-lint linters? HOT 4
- Feature Request: Support for neotest HOT 1
- Force Go Binary Usage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.nvim.