Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvim snap error on opening file #3580

Closed
Aflynn50 opened this issue Sep 5, 2023 · 2 comments
Closed

nvim snap error on opening file #3580

Aflynn50 opened this issue Sep 5, 2023 · 2 comments

Comments

@Aflynn50
Copy link

Aflynn50 commented Sep 5, 2023

What did you do? (required: The issue will be closed when not provided)

Open a non-empty go file in nvim. This error occurs every time I open a file. It started happening after I installed (and then removed) the plugins nvim-treesitter, nvim-lspconfig and ray-x/go.nvim. The error occurs even with the plugins removed from the system.

What did you expect to happen?

I expected it to open the file without crashing.

What happened instead?

I got this error

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:21: Error executing lua: /snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:22: BufReadPost Autocommands fo
r "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[21]..script /home/aflynn/.local/share/nvim/plugged/vim-go/ftplugin/go/commands.vim[108]..function go#package#InGOPATH, line
 15: Vim(let):E684: list index out of range: 0
stack traceback:
        [C]: in function 'nvim_cmd'
        /snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:22: in function </snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:21>
        [C]: in function 'nvim_buf_call'
        /snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:21: in function </snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        /snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:21: in function </snap/nvim/2809/usr/share/nvim/runtime/filetype.lua:10>

Configuration (MUST fill this out):

vim-go version:

vimrc you used to reproduce:

vimrc
call plug#begin()
Plug 'fatih/vim-go'
call plug#end()

Vim version (first three lines from :version):

Installed as a snap

NVIM v0.9.1
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Go version (go version):

go1.18.10 linux/amd64

Go environment

go env Output:
```
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/aflynn/.cache/go-build"
GOENV="/home/aflynn/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/aflynn/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/aflynn/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/10029"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/10029/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.10"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4233797071=/tmp/go-build -gno-record-gcc-switches"
```

gopls version

gopls version Output:
```
golang.org/x/tools/gopls v0.13.2
```
@bhcleek
Copy link
Collaborator

bhcleek commented Sep 6, 2023

I'm not sure what's going on here, but it something to do with the output of go list. It may be related to using snap. I've seen others have problems with snap for some reason. What does :!go list output when run from within vim after you get the error you documented above?

@Aflynn50
Copy link
Author

Aflynn50 commented Sep 6, 2023

That seems to be it, the go list command returns nothing when I do :! go list. It works fine when I do it from the command line.

Looks like the error is actually know about for the snap: neovim/neovim-snap#25.

I've installed it with the AppImage for now. Thanks!

@Aflynn50 Aflynn50 closed this as completed Sep 6, 2023
@Aflynn50 Aflynn50 changed the title nvim error on opening file nvim snap error on opening file Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants