microsoft / vscode-go

An extension for VS Code which provides support for the Go language. We have moved to https://github.com/golang/vscode-go
Other
5.93k stars 648 forks source link

Gutter code covergae is not displayed #2113

Closed RO-29 closed 5 years ago

RO-29 commented 5 years ago

- any Go related settings you might have added/changed - go version

                go version go1.11.1 darwin/amd64
   **    - go env**
    ```

GOARCH="amd64" GOBIN="" GOCACHE="/Users/rohit/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/rohit/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" 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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3b/ln1zj0815y95sf0qq565wsvr0000gn/T/go-build317454192=/tmp/go-build -gno-record-gcc-switches -fno-common"```

-- vs code settings.json

{
    "workbench.startupEditor": "none",

    "editor.fontFamily": "Menlo, Consolas, DejaVu Sans Mono, monospace",
    "terminal.integrated.fontSize": 14,
    "editor.lineHeight": 14,
    "editor.wordWrap": "on",
    "editor.insertSpaces": false,

    "files.autoSave": "onFocusChange",
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true,
    "files.useExperimentalFileWatcher": true,
    "files.associations": {
        "Gopkg.lock": "toml",
        "Makefile*": "makefile",
        "Dockerfile*": "dockerfile"
    },

    "git.enabled": false,

    "problems.decorations.enabled": true,

    "search.exclude": {
        "**/vendor/**":true,
        "**/node_modules": true,
        "**/bower_components": true
    },

    "go.gopath": "/Users/rohit/go",
    "go.goroot": "/usr/local/go",
    "go.autocompleteUnimportedPackages": true,
    "go.formatTool": "goimports",
    "go.buildOnSave": "package",
    "go.testOnSave": true,
    "go.testFlags": [
        "-short"
    ],
    "go.coverOnSave": true,
    "go.coverageDecorator": {
        "type": "gutter",
        "coveredGutterStyle": "blockgreen",
        "uncoveredGutterStyle": "blockred"
    },
    "go.vetOnSave": "off",
    "go.lintOnSave": "package",
    "go.lintTool": "gometalinter",
    "go.lintFlags": [
        "--disable-all",
        "--enable=deadcode",
        "--enable=gocyclo",
        "--enable=golint",
        "--enable=ineffassign",
        "--enable=misspell",
        "--enable=nakedret",
        "--enable=vet",
        "--tests",
        "--vendor",
        "--deadline=30s"
    ],
    "workbench.colorTheme": "Visual Studio Light",
    "editor.fontSize": 15,
    "editor.suggestFontSize": 20,
    "workbench.colorCustomizations": {
        "activityBarBadge.background": "#5C6BC0",
        "list.activeSelectionForeground": "#5C6BC0",
        "list.inactiveSelectionForeground": "#5C6BC0",
        "list.highlightForeground": "#5C6BC0",
        "scrollbarSlider.activeBackground": "#5C6BC050",
        "editorSuggestWidget.highlightForeground": "#5C6BC0",
        "textLink.foreground": "#5C6BC0",
        "progressBar.background": "#5C6BC0",
        "pickerGroup.foreground": "#5C6BC0",
        "tab.activeBorder": "#5C6BC0",
        "notificationLink.foreground": "#5C6BC0",
        "editorWidget.resizeBorder": "#5C6BC0",
        "editorWidget.border": "#5C6BC0",
        "settings.modifiedItemIndicator": "#5C6BC0",
        "settings.headerForeground": "#5C6BC0",
        "panelTitle.activeBorder": "#5C6BC0",
        "breadcrumb.activeSelectionForeground": "#5C6BC0",
        "menu.selectionForeground": "#5C6BC0",
        "menubar.selectionForeground": "#5C6BC0"
    },
    "materialTheme.accent": "Indigo",
    "git.decorations.enabled": false,
    "editor.glyphMargin": false,
    "workbench.iconTheme": "eq-material-theme-icons-darker",
    "sync.askGistName": true,
    "sync.autoDownload": true,
    "sync.gist": "XYZZZ",
    "editor.tabCompletion": "on",
    "editor.minimap.renderCharacters": false,
    "go.useLanguageServer": true,
    "editor.minimap.enabled": false,
    "go.coverOnSingleTest": true,
    "breadcrumbs.enabled": true,
    "search.location": "panel",
    "sync.removeExtensions": false
}

vscode-go version: 0.7.0

Steps to Reproduce:

  1. Save the code and run the tests
  2. Test pass OK but still no coverage seen screen shot 2018-11-10 at 1 46 17 am screen shot 2018-11-10 at 1 46 22 am
ramya-rao-a commented 5 years ago

You mentioned in your tweets, that changing the coverage type to "highlight" worked. Can you try the below

RO-29 commented 5 years ago

Make sure you don't have anything in your workspace settings that might be over-riding your user settings

checked, nothing

Edit only the type in the coverage decorator setting and not change the coveredGutterStyle and unCoveredGutterStyle

removed other settings

You have both go.coverOnSingleTest and go.coverOnSave enabled. Can you disable both and try using the Go: Toggle Code Coverage in Current Package instead?

done

still, after the above steps, the result is same.

that changing the coverage type to "highlight" worked

yes, it still works only type "gutter" type does not work.

I tried re-installing vs-code but no effect šŸ˜¢

RO-29 commented 5 years ago

OKKKKK I FINALLLY GOT THIS WORKING

editor.glyphMargin was set to false šŸ¤¦ā€ā™‚ļø šŸ¤¦ā€ā™‚ļø šŸ¤¦ā€ā™‚ļø

Sorry for the trouble!

ramya-rao-a commented 5 years ago

wow, I had no idea there was such a setting!

Happy Coding!