Skip to content

Linting package loses line information for lint issues #743

Closed
@A-UNDERSCORE-D

Description

@A-UNDERSCORE-D

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.15.2 linux/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.49.2 -- x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.17.2
  • Run go env to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/ad/development/go/bin"
GOCACHE="/home/ad/.cache/go-build"
GOENV="/home/ad/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ad/development/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ad/development/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ad/development/go/gopaste/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build741992281=/tmp/go-build -gno-record-gcc-switches"

Share the Go related settings you have added/edited

    "go.useLanguageServer": true,
    "go.languageServerExperimentalFeatures": {
        "diagnostics": true,
        "documentLink": true,
    },
    "gopls": {
        "gofumpt": true,
        "analyses": {
            "fillreturns": true,
            "undeclaredname": true,
            "unusedparams": true,
            "nonewvars": true,
        },
        "staticcheck": true,
    },
    "go.autocompleteUnimportedPackages": true,
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "go.delveConfig": {
        "dlvLoadConfig": {
            "followPointers": true,
        },
    },
    "go.buildOnSave": "workspace",
    "go.testFlags": [
        "-race",
        "-v"
    ],
    "go.addTags": {
        "tags": "toml",
        "promptForTags": true,
        "options": "",
        "transform": "snakecase"
    },
    "go.removeTags": {
        "tags": "",
        "options": "",
        "promptForTags": true
    },
    "go.formatTool": "goimports",
    "go.lintFlags": [
        "--fast"
    ],
    "[go]": {
        "editor.codeActionsOnSave": {
            "source.fixAll": true
        }
    },

Describe the bug

Lint issue location on line (as in from index x to y, for underlining. See image below)
I would expect both issue existence and line location to be kept.

Steps to reproduce the behavior:

  1. Open multi-file project with issues in multiple files
  2. Open two or more files, both of which with lint issues
  3. Save (or otherwise trigger linters)
  4. Switch to another file, note that any issues are underlined incorrectly (only the whitespace preceding the line is underlined)

Screenshots or recordings

Expected behavior (file was linted with that file's tab open)
Screenshot from 2020-10-05 15-30-37

Actual behavior when linting another file and this one gets caught up with it:
Screenshot from 2020-10-05 15-30-27

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions