Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Autocompletion of current function doesn't happen in Godoc comment #1291

Closed
atombender opened this issue Oct 19, 2017 · 4 comments
Closed

Autocompletion of current function doesn't happen in Godoc comment #1291

atombender opened this issue Oct 19, 2017 · 4 comments

Comments

@atombender
Copy link

atombender commented Oct 19, 2017

vsc

Say I have this:

// SetT<caret>
func SetThing() {
}

I expect code completion to automatically suggest SetThing for me. If I type SetT, nothing happens. If hit cmd-space to force autocompletion, I might get SetThing (or something else starting with SetT), but it's a textual autocompletion, not a code completion.

Apologies if this has come up before. I distinctly remember writing about it in a comment, a long time ago.

@ramya-rao-a
Copy link
Contributor

There are multiple layers at play here

  1. Completions do not appear as you type when inside comments. This is a VS Code feature. You can tweak this by editing the editor.quickSuggestions setting
  2. When you do force a autocompletion, the Go extension intentionally does not invoke gocode for suggestions when typing inside a line comment as it was considered as noise
  3. Funnily gocode does get invoked when you are inside a block comment. This is because there was no simple way of figuring out the start and end of the block comment without parsing the whole file contents

One solution I have in mind is to invoke gocode for line comments if editor.quickSuggestions supported comments. i.e if editor.quickSuggestions was set to true or editor.quickSuggestions.comments was set to true, then the Go extension will return suggestions when inside comments.

Or we will have to introduce a new setting just to enable suggestions inside comments

Thoughts?

@atombender
Copy link
Author

atombender commented Oct 21, 2017 via email

@zh-h
Copy link

zh-h commented Feb 12, 2018

default

@atombender 27197ae This is my solution, but i thing it is useless now😥

@ramya-rao-a
Copy link
Contributor

Closing this in favor of #1005

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants