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
Omnicomplete isn't inserting the parameters' of the function.
When browsing the omnicomplete options (arrowing up/down):
the Preview window changes to show the selected item in the menu.
the current line changes to show the select with an open (.
For example, when typing fmt. and then C-X and C-O, this is what is shown when I arrow-down to the func Fprint(w io.Writer, a ...interface{}) menu item and select it:
fmt.Fprint(
Even though the identifier information is actually shown in the Menu item, as well as the Preview as:
func Fprint(w io.Writer, a ...interface{}) (n int, err error)
Expected behavior
I tried with various funcs and types.
Once selecting the Menu item from the Omnicomplete menu, I would expect the line of text to read:
fmt.Fprint(w, a...)
...or at least...
fmt.Fprint(w)
(omitting the variadic parameters)
I have seen where the author has created this functionality. See below screenshot from PR #685, which looks like exactly what I am after:
You'll see that fmt.Errorf("") inserts the quotation marks (because its required), omitting the variadic parameters. Whereas the selection of fmt.Println() is empty because it has all variadic parameters.
I also tried fmt.Errorf just as the image shows above and all I get is:
`fmt.Errorf(`
It doesn't complete the last ) nor does it insert the quotation marks "".
Steps to reproduce:
Very simple reproduction steps:
Create a new .vimrc-test and load only the vim-go plugin. The .vimrc-test below is configured for vim-plug. Also tried pathogen.
Run vim -u ~/.vimrc-test main.go or nvim -u ~/.vimrc-test main.go to load the minimized config file and start testing.
Test omnicomplete.
(the above assumes you already have vim-go plugin in .vim/plugged. If not, edit the location on line 4)
Configuration
.vimrc-test
set nocompatible
" Change this to your plugin folder. '~/.vim/bunded' perhaps?
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go', { 'do' : 'vim +GoUpdateBinaries +qall && gometalinter --install --update' }
call plug#end()
function! VimGoSetup()
" vim-go related mappings
au FileType go nmap <Leader>gi <Plug>(go-info)
au FileType go nmap <Leader>gI <Plug>(go-install)
au FileType go nmap <Leader>gs <Plug>(go-implements)
au FileType go nmap <Leader>gr <Plug>(go-run)
au FileType go nmap <Leader>gb <Plug>(go-build)
au FileType go nmap <Leader>gt <Plug>(go-test)
au FileType go nmap <Leader>gc <Plug>(go-coverage)
au FileType go nmap <Leader>ge <Plug>(go-rename)
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <Leader>gB <Plug>(go-doc-browser)
au FileType go nmap <Leader>gd <Plug>(go-def-vertical)
au FileType go nmap <Leader>ds <Plug>(go-def-split)
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
endfunction
call VimGoSetup()
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 23 2016 14:13:02)
MacOS X (unix) version
$ nvim --version
NVIM 0.1.2
vim-go version (latest)
[eric@zoe][~/.vim/plugged/vim-go][master]
$ git log
commit 3efc952a7fb754b43b4c21474046126562f83efc
Author: Fatih Arslan <ftharsln@gmail.com>
Date: Mon Mar 28 13:18:04 2016 +0300
Merge pull request #778 from moorereason/iss777
syntax: Fix gotexttmpl identifier highlighting
$ go version
go version go1.6 darwin/amd64
The text was updated successfully, but these errors were encountered:
This is how the completion is done. For the last ) it depends on which plugin you use (such as neocomplete, deoplete, etc ....). You should configure to add the parentheses or remove them.
Unfortunately there is now way to complete it based on the arguments. The reason is the arguments are something that needs to be changed and Vim doesn't have a snippet based replacement system included. So it's impossible to implement it the way we want. Thanks for opening the issue.
Ah, i completely mis-read that PR. I thought you were doing auto-complete. Turns out you were updating the statusline with that info. Yeah, I've had that working.
And yes, I've used neocomplete (vim) and switched to deoplete (neovim) lately (disabled them to try to get the "") to insert like the image). But now I see that was done with one of those plugins, not vim-go. I've also experienced the closing ) with them but never had parameters inserting between it, like full blown IDEs have.
Thanks for the info about the snippet based system. Sounds like you've researched this greatly in the past. 👍
Actual behavior
Omnicomplete isn't inserting the parameters' of the function.
When browsing the omnicomplete options (arrowing up/down):
(
.For example, when typing
fmt.
and then C-X and C-O, this is what is shown when I arrow-down to thefunc Fprint(w io.Writer, a ...interface{})
menu item and select it:Even though the identifier information is actually shown in the Menu item, as well as the Preview as:
Expected behavior
I tried with various funcs and types.
Once selecting the Menu item from the Omnicomplete menu, I would expect the line of text to read:
...or at least...
(omitting the variadic parameters)
I have seen where the author has created this functionality. See below screenshot from PR #685, which looks like exactly what I am after:
You'll see that
fmt.Errorf("")
inserts the quotation marks (because its required), omitting the variadic parameters. Whereas the selection offmt.Println()
is empty because it has all variadic parameters.I also tried
fmt.Errorf
just as the image shows above and all I get is:It doesn't complete the last
)
nor does it insert the quotation marks""
.Steps to reproduce:
Very simple reproduction steps:
.vimrc-test
below is configured for vim-plug. Also tried pathogen.vim -u ~/.vimrc-test main.go
ornvim -u ~/.vimrc-test main.go
to load the minimized config file and start testing.(the above assumes you already have vim-go plugin in .vim/plugged. If not, edit the location on line 4)
Configuration
.vimrc-test
vim-go version (latest)
The text was updated successfully, but these errors were encountered: