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

gocode autocompletion not working when using // in Sprintf #2240

Closed
norilt opened this issue Jan 10, 2019 · 9 comments
Closed

gocode autocompletion not working when using // in Sprintf #2240

norilt opened this issue Jan 10, 2019 · 9 comments

Comments

@norilt
Copy link

norilt commented Jan 10, 2019

If you are using fmt.Sprintf("//%s", #), no autocompletion on postion # is available. However with vim and mdempsky/gocode it is working.

Example Code:

package main

import (
	"fmt"
)

type test struct {
	Test2 string
}

func main() {
	var t test
	fmt.Sprintf("http://%s", ####)
}

When you are running gocode in debug mode, you can see, that no request against gocode is made. It looks like vscode is consuming the request.

vscode 1.30.2
ms-vscode.Go@0.8.0
go version go1.11.4 linux/amd64
@norilt norilt changed the title gocode autocompletion not working when using // gocode autocompletion not working when using // in Sprintf Jan 10, 2019
@ramya-rao-a
Copy link
Contributor

Thanks for reporting this @norilt

This is happening because there is a logic in place to avoid calling gocode when anything is typed after // as it is thought to be a comment.

We need to be a little more smarter there and not consider // inside a string as comment

@ramya-rao-a
Copy link
Contributor

PRs are welcome to fix this bug

Code Pointers:

@rajdhandus
Copy link

@ramya-rao-a - can i please work on this issue?

@oneslash
Copy link
Contributor

@rajdhandus feel free to fix it

@ramya-rao-a
Copy link
Contributor

@rajdhandus Definitely, go ahead :)

@mossplix
Copy link

mossplix commented Feb 7, 2019

Is someone working on this?

@oneslash
Copy link
Contributor

oneslash commented Feb 9, 2019

since there was no PR from @rajdhandus, I have done mine #2316

@ramya-rao-a
Copy link
Contributor

The latest beta version (0.9.3-beta.2) of this extension has the fix for this issue

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 18, 2019
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 23, 2019

The fix for this issue is out in the latest release(0.10.0) of the Go extension

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants