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

Function complete without types sometimes drops parameters #1279

Closed
btracey opened this issue Oct 13, 2017 · 2 comments · Fixed by #1284
Closed

Function complete without types sometimes drops parameters #1279

btracey opened this issue Oct 13, 2017 · 2 comments · Fixed by #1284

Comments

@btracey
Copy link

btracey commented Oct 13, 2017

Using the "go.useCodeSnippetsOnFunctionSuggestWithoutType" as true sometimes autocompletes without the names of parameters. I haven't been able to fully understand the rule, but it happens sometimes when there are multiple parameters of the same type.

A code snippet that reproduces this is

package main

type ScoreInputer interface {
	ScoreInput(score, x []float64) []float64
}

func main(){
	var s ScoreInputer
	s.ScoreInput(, x)
}

When completing the ScoreInput, the score name is not filled in.

Full settings:

{
    "editor.wordWrap": "on",
    "editor.wordBasedSuggestions": false,
    "editor.rulers": [
        80
    ],

    "window.openFilesInNewWindow": "on",
    "window.restoreWindows": "all",
    "window.closeWhenEmpty": true,

    "go.buildOnSave": "package",
    "go.vetOnSave": "off",
    "go.formatOnSave": true,
    "go.formatTool": "goimports",
    "go.lintOnSave": "off",
    "go.useDiffForFormatting": false,
    "go.gocodeAutoBuild": false,
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
    "[go]": {
        "editor.wordWrap": "off",
        "editor.wordBasedSuggestions": true,
        "editor.formatOnSave": true
    },

    "git.enabled": false
}
@ramya-rao-a
Copy link
Contributor

@btracey Good catch!

@alexkohler Can you take a look? Should be a simple fix.

@alexkohler
Copy link
Contributor

Nice catch! @ramya-rao-a Sure - I'll take a look later today.

alexkohler pushed a commit to alexkohler/vscode-go that referenced this issue Oct 16, 2017
ramya-rao-a pushed a commit that referenced this issue Oct 18, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants