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

complete: show identifier information after completion is done #685

Merged
merged 5 commits into from
Jan 19, 2016

Conversation

fatih
Copy link
Owner

@fatih fatih commented Jan 16, 2016

This is a new feature that prints the information of the completed identifier in statusline. This is experimental.

closes #663

This is a new feature that prints the information of the completed
identifier in statusline. This is experimental

closes #663
@kodek
Copy link

kodek commented Jan 16, 2016

This is exactly what I'm looking for, but it seems to be a bit glitchy at the moment. I generally use tab to select a match, then I type the opening parenthesis to close the autocomplete list. If I do that, the function signature does not show up. How are you triggering the autocomplete of "" and the opening/closing parentheses?

Also, I had to set noshowmode to hide the overlapping mode status. Powerline shows it anyway.

@fatih
Copy link
Owner Author

fatih commented Jan 16, 2016

@kodek push a better approach. Now it's much more efficient and should just work out of the box. Can you please test and return me your thoughts ?

@kodek
Copy link

kodek commented Jan 16, 2016

Not working at all right now :( Let me know if there's anything you'd like me to test.

@remeh
Copy link

remeh commented Jan 16, 2016

Is it also bound on a command (e.g. GoSignature) or is it only on auto-complete ? Anyway, great feature!

@fatih
Copy link
Owner Author

fatih commented Jan 18, 2016

@remeh it's all automatically. It works perfect for me and actually all I do is echoing the current completion from the cache. There is no magic, but the statusline is a place that many other plugins, sub systems of vim uses. So even though I display it, it might be overwritten meanwhile by something else. So it's tricky :)

@@ -129,6 +142,10 @@ augroup vim-go
autocmd CursorHold *.go nested call go#complete#Info()
endif

" Echo the identifier information when completion is done. Useful to see
" the signature of a function, etc...
autocmd CompleteDone *.go nested call s:echo_go_info()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the check of CompleteDone is needed.
if exists('##CompleteDone')

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah definitely @Shougo 👍 Should it not with one # ? Your example has two ##. If yes why it is that way ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

##event is the check of the event is supported.
From :help exists():

            ##event     autocommand for this event is
                    supported.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks! Fixed now.

@kodek
Copy link

kodek commented Jan 18, 2016

I think my issue is related to a YCM conflict. I just realized I might be using the wrong autocomplete engine. Trying to fix, but I'll report back. Sorry!

fatih added a commit that referenced this pull request Jan 19, 2016
complete: show identifier information after completion is done
@fatih fatih merged commit 6bcbaed into master Jan 19, 2016
@fatih fatih deleted the show-type-info-complete branch January 19, 2016 01:16
@gonzaloserrano
Copy link

@kodek i'm also using YCM and i must have the info beeing overwritten so if you find the reason please share 👍

@eduncan911
Copy link

Btw, I have been searching for this fix/feature for months! Man, was it buried down deep in the Closed issues. This should be on the Homepage as a feature!

Now, onto the issue...

I can't seem to get this to work. Vim acts normally:

  • no match # of # ever shows up while scrolling through the C-x C-o menu options.
  • -- INSERT -- remains in the statusline at all times.
  • selecting fmt.Printf from the omnicomplete menu does not insert the parameters.

On this revision:

commit fd5661a1e16a1fd41385d7011877bfa1f0a1353f
Merge: 5f64a57 65ef9bc
Author: Fatih Arslan <ftharsln@gmail.com>
Date:   Thu Mar 3 09:37:40 2016 +0200

    Merge pull request #748 from bhcleek/master
    show output of :GoRun

Tried a few random things:

  • disabled neocomplete
  • disabled omnicomplete's completeopt changes, the "Preview" buffer came back.
  • had several omnicomplete tweaks (inoremap), disabled all.
  • saw issues with symlinks and vim; moved my /USB/HDD/go/src/... to ~/go/src/... (no more symlinks)
  • disabling vim-sensible

For testing, I closed VIM each time and attempted reopen and edit a known .go file with known local func()s as well as accessing some of the standard library packages (os, fmt), and some other packages I wrote in my github location.

Nada.

One thing to note: :GoDoc doesn't seem to be able to find anything in my GOPATH; it only finds documentation for std lib stuff.

EDIT: I noticed that if I insert this into my .vimrc, that match # of # now shows along with the func definition:

set noshowmode

I have vim-sensible setup the defaults for my .vimrc; so, perhaps it has showmode or alike.

^- while that has been fixed, I still do not get the auto-completion of the "" when selecting fmt.Printf() from the autocomplete.

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 this pull request may close these issues.

Show function signature when filling its arguments
6 participants