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 removed all the template questions because this isn't a bug)
Hi there!
I recently configured my Vim setup to work with the new-ish rules_go packages driver, and I wanted to update the Editor setup wiki page with instructions.
I figured I'd check in first to see 1) if that was a welcome contribution, and 2) how to go about submitting a wiki PR/contribution. I came across these suggestions in searching around.
It's also worth noting that this is my first foray into Vimscript, and it's likely hideous to someone more familiar with it.
The TL;DR:
.vimrc update
function!MaybeSetGoPackagesDriver()
" Start at the current directory and see if there's a WORKSPACE file in the" current directory or any parent. If we find one, check if there's a" gopackagesdriver.sh in a tools/ directory, and point our" GOPACKAGESDRIVER env var at it.letl:dir=getcwd()
whilel:dir!="/"iffilereadable(simplify(join([l:dir, 'WORKSPACE'], '/')))
letl:maybe_driver_path=simplify(join([l:dir, 'tools/gopackagesdriver.sh'], '/'))
iffilereadable(l:maybe_driver_path)
let$GOPACKAGESDRIVER=l:maybe_driver_pathbreakendendletl:dir=fnamemodify(l:dir, ':h')
endwhileendfunctioncallMaybeSetGoPackagesDriver()
" See https://github.com/golang/tools/blob/master/gopls/doc/settings.mdletg:go_gopls_settings= {
\ 'build.directoryFilters': [
\ '-bazel-bin',
\ '-bazel-out',
\ '-bazel-testlogs',
\ '-bazel-mypkg',
\ ],
\ 'ui.completion.usePlaceholders': v:true,
\ 'ui.semanticTokens': v:true,
\ 'ui.codelenses': {
\ 'gc_details': v:false,
\ 'regenerate_cgo': v:false,
\ 'generate': v:false,
\ 'test': v:false,
\ 'tidy': v:false,
\ 'upgrade_dependency': v:false,
\ 'vendor': v:false,
\ },
\ }
The text was updated successfully, but these errors were encountered:
Sounds good, I've created a PR to add that to docs/go/editors/. This does mean editor documentation is fragmented between the wiki and the docs/ directory though, we'll likely want to either merge these docs into the wiki, or move the existing editor setup wiki page to docs/ (and leave a link to docs/ on the wiki page, to not break existing links)
* Add editor setup instructions for Vim + vim-go
Addresses #3056 by adding
basic instructions to get `gopls` working with autogenerated Bazel
files. Tested locally and working for protobuf as well as custom Bazel
rules + macros that generate `go_library` targets.
(I removed all the template questions because this isn't a bug)
Hi there!
I recently configured my Vim setup to work with the new-ish rules_go packages driver, and I wanted to update the Editor setup wiki page with instructions.
I figured I'd check in first to see 1) if that was a welcome contribution, and 2) how to go about submitting a wiki PR/contribution. I came across these suggestions in searching around.
It's also worth noting that this is my first foray into Vimscript, and it's likely hideous to someone more familiar with it.
The TL;DR:
.vimrc update
The text was updated successfully, but these errors were encountered: