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

gopls: don't allow unrequested source code modifications #2498

@oakad

Description

@oakad

I'm using vscode 1.33.1/vscode-go 0.10.2/go 1.12.3

My user config file has the following set:

    "go.languageServerExperimentalFeatures": {
        "format": false,
     },
    "go.lintOnSave": "off",
    "go.useLanguageServer": true,
    "go.vetOnSave": "off",
    "[go]": {
        "editor.formatOnSave": false
    },

However, when using gopls the following behavior happens:

  1. Files are always formatted on save
  2. Imports are reordered

For many various reasons, this is not a desirable behavior. First, formatOnSave setting is not honored as it should be. Second, there should be a setting which prevents gopls from ever introducing any automatic changes to source code files unless explicitly requested by user, via context menu or command prompt.

I'm most surprised that the above is not the default setting already, as RCS noise is a major nuisance in large code bases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions