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

On file save few characters gets deleted #2921

Closed
VijayUpadhyay opened this issue Nov 29, 2019 · 4 comments
Closed

On file save few characters gets deleted #2921

VijayUpadhyay opened this issue Nov 29, 2019 · 4 comments
Labels
upstream-gopls Issue for gopls

Comments

@VijayUpadhyay
Copy link

We have writ
Issue Type: Bug

Following Golang file:

package deckinfo
import "fmt"
//deck ...represen string array of cards
type deck []string
//NewDeck ...representsewly created decks
func NewDeck() deck {
return []string{"a", "n"}
}
func (d deck) Print() {
f _, val := range d {
fmt.Printf("val is: %s", val)
}
}

It changes in below format while saving(ctrl+s)

package deckinfo
import "fmt"
//deck ...represen string array of cards
ype deck []string
//NewDeck ...representsewly created decks
fnc NewDeck() deck {
eturn []string{"a", "n"}
}
func (d deck) Print() {
f _, val := range d {
fmt.Printf("val is: %s", val)
}
}
Extension version: 0.11.9
VS Code version: Code 1.40.2 (f359dd69833dd8800b54d458f6d37ab7c78df520, 2019-11-25T14:54:45.096Z)

Please let me know what is the issue or if we have any fix for this in upcoming releases.

@ramya-rao-a
Copy link
Contributor

Please share all Go related settings that you might have added/edited.
You can get these by running the Preferences: Open Settings(JSON) command.

@VijayUpadhyay
Copy link
Author

VijayUpadhyay commented Dec 4, 2019

This is my settings.json file
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.startupEditor": "newUntitledFile",
"go.buildOnSave": "package",
"go.inferGopath": false,
"go.gopath": "C:/Users/vijay/Documents/goproject",
"go.lintOnSave": "workspace",
"go.vetOnSave": "workspace",
"go.formatTool": "goreturns",
"go.toolsGopath": "C:/Users/vijay/go/bin",
"[go]": {
"editor.wordBasedSuggestions": true,
"editor.tabCompletion": "on",
"editor.autoIndent": true,
"editor.copyWithSyntaxHighlighting": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": true,
},
"editor.codeActionsOnSaveTimeout": 600,
"editor.formatOnSave": true,
"editor.trimAutoWhitespace": true,
"editor.showUnused": true,
},
"go.useLanguageServer": true,
"explorer.incrementalNaming": "smart",
"go.autocompleteUnimportedPackages": true
}
Please have a look and let me know what needs to be updated/changed?

@stamblerre
Copy link
Contributor

This sounds like golang/go#34955. Can you comment on that issue and answer the questions listed there?

@ramya-rao-a ramya-rao-a added upstream-gopls Issue for gopls and removed needs more info labels Dec 5, 2019
@ramya-rao-a
Copy link
Contributor

@VijayUpadhyay Thanks for sharing the settings.
Since you are using the language server, this is related to gopls and so the issue @stamblerre linked above would be the right place to follow up.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream-gopls Issue for gopls
Projects
None yet
Development

No branches or pull requests

3 participants