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

Generic type reports syntax error #3398

Closed
clohr-vc opened this issue Apr 12, 2022 · 2 comments
Closed

Generic type reports syntax error #3398

clohr-vc opened this issue Apr 12, 2022 · 2 comments

Comments

@clohr-vc
Copy link

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

package main

type Bunch[E any] []E

What did you expect to happen?

No syntax error reported.

What happened instead?

image

Configuration (MUST fill this out):

vim-go version:

f42b069ffd4ba756461b717411595ffc7b2bccb2

vimrc you used to reproduce:

vimrc
" VIM - GO 
"
" disable all linters as that is taken care of by coc.nvim
let g:go_diagnostics_enabled = 0
let g:go_metalinter_enabled = []

" don't jump to errors after metalinter is invoked
let g:go_jump_to_error = 0

" run go imports on file save
let g:go_fmt_command = "goimports"

" automatically highlight variable your cursor is on
let g:go_auto_sameids = 0

" Syntax highlights
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_operators = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1

Vim version (first three lines from :version):

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 30 2022 16:28:45)
Included patches: 1-3956
Modified by Solus

Go version (go version):

go version go1.18 linux/amd64

Go environment

go env Output:
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xx/.cache/go-build"
GOENV="/home/xx/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/xx/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/xx/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xx/repos/xx/xx/go.mod"
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-build1753688273=/tmp/go-build -gno-record-gcc-switches"

gopls version

gopls version Output:
golang.org/x/tools/gopls v0.8.2
    golang.org/x/tools/[email protected] h1:+b7X2FDwmP7vxyYNOHe/ZFkecN5X8OtAgkNtuCr86wk=

vim-go configuration:

vim-go configuration
g:go_highlight_extra_types = 1
g:go_highlight_operators = 1
g:go_highlight_function_calls = 1
g:go_highlight_fields = 1
g:go_diagnostics_enabled = 0
g:go_auto_sameids = 0
g:go_highlight_functions = 1
g:go_metalinter_enabled = []
g:go_highlight_types = 1
g:go_fmt_command = 'goimports'
g:go_jump_to_error = 0
g:go_loaded_gosnippets = 1
g:go_highlight_generate_tags = 1
g:go_highlight_build_constraints = 1
g:go_loaded_install = 1

filetype detection configuration:

filetype detection
filetype detection:ON  plugin:ON  indent:ON

coc settings:

coc settings
{
  "suggest.noselect": false,
  "diagnostic.errorSign": "✘",
  "diagnostic.warningSign": "!",
  "diagnostic.infoSign": "?",
  "diagnostic.checkCurrentLine": true,
  "coc.preferences.formatOnSaveFiletypes": [
    "javascript",
    "html",
    "json",
    "css",
    "scss",
    "go"
  ],
  "coc.preferences.hoverTarget": "float",
  "languageserver": {
    "golang": {
      "command": "gopls",
      "rootPatterns": ["go.mod"],
      "filetypes": ["go"]
    }
  },
  "go.goplsOptions": {
    "staticcheck": true
  }
}
@bhcleek
Copy link
Collaborator

bhcleek commented Apr 12, 2022

While vim-go does not yet have the syntax support for generics (it's in the works, and there's a draft PR already open if you want to try it), the error you're seeing is not from vim-go.

@bhcleek bhcleek closed this as completed Apr 12, 2022
@clohr-vc
Copy link
Author

Thought as much as I went through the other plugins. I suspect COC. Thank you for your swift response!

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