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

Import string is not highlighted if some comment follows #3656

Closed
rhysd opened this issue Apr 12, 2024 · 0 comments · Fixed by #3657
Closed

Import string is not highlighted if some comment follows #3656

rhysd opened this issue Apr 12, 2024 · 0 comments · Fixed by #3657

Comments

@rhysd
Copy link
Contributor

rhysd commented Apr 12, 2024

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

  1. Save the following code as foo.go
  2. Open the file with Vim (vim foo.go)
package main

import (
	"fmt" // For Println
	"path/filepath"
)

func main() {
	fmt.Println(filepath.FromSlash("hello/world"))
}

What did you expect to happen?

Import strings are highlighted correctly.

What happened instead?

image

Import string followed by the comment was not highlighted.

Configuration (MUST fill this out):

vim-go version: 14eedf6

vimrc you used to reproduce:

vimrc
let g:go_def_mapping_enabled = 0
let g:go_code_completion_enabled = 0
let g:go_gopls_enabled = 0
let g:go_doc_keywordprg_enabled = 0
let g:go_diagnostics_enabled = 0

let g:go_snippet_engine = ''
let g:go_highlight_trailing_whitespace_error = 0
let g:go_play_open_browser = 1
let g:go_highlight_chan_whitespace_error = 0
let g:go_highlight_extra_types = 0
let g:go_highlight_space_tab_error = 0
let g:go_highlight_array_whitespace_error = 0
let g:go_highlight_functions = 1
let g:go_metalinter_autosave_enabled = []
let g:go_fmt_command = 'goimports'

Vim version (first three lines from :version):

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan 04 2024 03:00:35)

Go version (go version):

go version go1.22.2 darwin/amd64

Go environment

go env Output:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/rhysd/Library/Caches/go-build'
GOENV='/Users/rhysd/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/rhysd/.go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/rhysd/.go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/Cellar/go/1.22.2/libexec/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/98/2tcw8j4157578xpvbqfrwdyr0000gn/T/go-build452980675=/tmp/go-build -gno-record-gcc-switches -fno-common'

gopls version

gopls version Output:
golang.org/x/tools/gopls v0.15.2
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

Successfully merging a pull request may close this issue.

1 participant