You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error when opening a go file that uses the new module versioning
go.mod:3: invalid go version '1.21.3': must match format 1.23
This seems to be causing a lot of trouble with various software projects - after some discussions on the Gitter, I believe we need to update the verison of gopls to be compatible with these new versioning formats.
I have searched YCM's issue tracker to find issues similar to the one I'm
about to report and couldn't find an answer to my problem. (Example Google
search.)
If filing a bug report, I have included the output of vim --version.
If filing a bug report, I have included the output of :YcmDebugInfo.
If filing a bug report, I have attached the contents of the logfiles using
the :YcmToggleLogs command.
If filing a bug report, I have included which OS (including specific OS
version) I am using.
If filing a bug report, I have included a minimal test case that reproduces
my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I
expected to happen and what actually happened.
If filing a installation failure report, I have included the entire output
of install.py (or cmake/make/ninja) including its invocation
I understand this is an open-source project staffed by volunteers and
that any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
I understand my issue may be closed if it becomes obvious I didn't
actually perform all of these steps.
Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Issue Details
Include steps to reproduce here.
vim -Nu ~/.bundle/YouCompleteMe/vimrc_ycm_minimal
:e test.go
Observe error loading packages
Include description of a minimal test case, including any actual code required
to reproduce the issue.
Set up a new go module with some dependencies as a pre-requisite for reproducing the issue
$ mkdir ycm_test && cd ycm_test
$ cat >test.go << EOF
> package test
>
> import (
> "github.com/stretchr/testify/require"
> )
> EOF
$ go mod init ycm_test
go: creating new go.mod: module ycm_test
go: to add module requirements and sums:
go mod tidy
$ go get -u
go: added github.com/davecgh/go-spew v1.1.1
go: added github.com/pmezard/go-difflib v1.0.0
go: added github.com/stretchr/testify v1.8.4
go: added gopkg.in/yaml.v3 v3.0.1
$ cat go.mod
module ycm_test
go 1.21.3
require github.com/stretchr/testify v1.8.4
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
What did you expect to happen?
I expected the packages to load and go completion to work correctly
What actually happened?
Received an error due to malformed go version in go.mod
Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /var/folders/tm/dpc775t148v9n9cjlvr3vby80000gn/T/ycm_tu5abj6r.log
-- Server Python interpreter: /opt/homebrew/opt/[email protected]/bin/python3.11
-- Server Python version: 3.11.6
-- Server has Clang support compiled in: False
-- Clang version: None
-- No extra configuration file found
-- Go completer debug information:
-- gopls running
-- gopls process ID: 35423
-- gopls executable: ['/Users/dhh/.bundle/YouCompleteMe/third_party/ycmd/third_party/go/bin/gopls', '-logfile', '/var/folders/tm/dpc775t148v9n9cjlvr3vby80000gn/T/gopls_stderr6p3y7lbu.log', '-rpc.trace']
-- gopls logfiles:
-- /var/folders/tm/dpc775t148v9n9cjlvr3vby80000gn/T/gopls_stderr6p3y7lbu.log
-- gopls Server State: Initialized
-- gopls Project Directory: /Users/dhh/ycm_test
-- gopls Settings: {
-- "hints": {
-- "assignVariableTypes": true,
-- "compositeLiteralFields": true,
-- "compositeLiteralTypes": true,
-- "constantValues": true,
-- "functionTypeParameters": true,
-- "parameterNames": true,
-- "rangeVariableTypes": true
-- },
-- "hoverKind": "Structured",
-- "semanticTokens": true
-- }
-- Server running at: http://127.0.0.1:61297
-- Server process ID: 35422
-- Server logfiles:
-- /var/folders/tm/dpc775t148v9n9cjlvr3vby80000gn/T/ycmd_61297_stdout_f5jq3757.log
-- /var/folders/tm/dpc775t148v9n9cjlvr3vby80000gn/T/ycmd_61297_stderr_brp9qglu.log
-- Semantic highlighting supported: True
-- Virtual text supported: True
-- Popup windows supported: True
Output of YcmDiags
No warnings or errors detected.
Output of git rev-parse HEAD in YouCompleteMe installation directory
$ git -C ~/.bundle/YouCompleteMe rev-parse HEAD
cc9a3ae3efdcc7d038aab0620ea28882533c236c
Contents of YCM, ycmd and completion engine logfiles
Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a gist containing all of the log files listed by :YcmToggleLogs.
Issue Prelude
I'm getting the following error when opening a go file that uses the new module versioning
This seems to be causing a lot of trouble with various software projects - after some discussions on the Gitter, I believe we need to update the verison of gopls to be compatible with these new versioning formats.
Workaround
Update
gopls
version using the cliModify
.vimrc
to point to the new versionPlease complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
Frequently Asked Questions section.
about to report and couldn't find an answer to my problem. (Example Google
search.)
vim --version
.:YcmDebugInfo
.the
:YcmToggleLogs
command.version) I am using.
my issue, using
vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what Iexpected to happen and what actually happened.
of
install.py
(orcmake
/make
/ninja
) including its invocationthat any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
actually perform all of these steps.
Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Issue Details
vim -Nu ~/.bundle/YouCompleteMe/vimrc_ycm_minimal
:e test.go
Set up a new go module with some dependencies as a pre-requisite for reproducing the issue
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Output of
YcmDiags
Output of
git rev-parse HEAD
in YouCompleteMe installation directoryContents of YCM, ycmd and completion engine logfiles
https://gist.github.com/dhharris/3df11077da7771a80b67d62ae6f7a823
OS version, distribution, etc.
The text was updated successfully, but these errors were encountered: