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

v0.14.1 does not seem to install gopls anymore #3194

Closed
MorpheusXAUT opened this issue Apr 20, 2020 · 4 comments · Fixed by #3197
Closed

v0.14.1 does not seem to install gopls anymore #3194

MorpheusXAUT opened this issue Apr 20, 2020 · 4 comments · Fixed by #3197

Comments

@MorpheusXAUT
Copy link

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

  • Run go version to get version of Go
    • go version go1.14.2 linux/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.44.2 ff915844119ce9485abfe8aa9076ec76b5300ddd x64 (Windows 10)
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.14.1
  • Run go env GOOS GOARCH to get the operating system and processor architecture details
    • linux amd64

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] prefixes.

{
    "go.useLanguageServer": true,
    "[go]": {
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true,
        },
        "editor.snippetSuggestions": "none",
    },
    "[go.mod]": {
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true,
        },
    },
    "gopls": {
        "usePlaceholders": true,
        "staticcheck": false,
    },
    "go.autocompleteUnimportedPackages": true,
    "go.lintTool": "golangci-lint",
    "go.lintFlags": [
        "--fast"
    ],
    "go.testFlags": [
        "-cover",
        "-race",
        "-count=1",
        "-v"
    ]
}

Describe the bug

I am using a Devcontainer setup for Go, running an golang:1.14.2 Docker image on a Windows 10 host. After updating to the latest version of vscode-go (0.14.1), the extension doesn't seem to install gopls in the devcontainer anymore and no prompt to install/update it is shown.

Using the "go.useLanguageServer": true setting as described here, I expected the extension to install gopls as required.

Manually downgrading vscode-go to version 0.13.1 and reloading the window prompts for a gopls install as it was detected missing.

Steps to reproduce the behavior:

  1. Install vscode-go 0.14.1
  2. Setup devcontainer environment with golang:1.14.2 image
  3. Re-open project in container, no prompt to install gopls appears
@MorpheusXAUT MorpheusXAUT changed the title v0.14.0 does not seem to install gopls anymore v0.14.1 does not seem to install gopls anymore Apr 20, 2020
@hyangah
Copy link
Contributor

hyangah commented Apr 20, 2020

I could reproduce this.

https://github.com/microsoft/vscode-go/blob/master/src/goLanguageServer.ts#L302
The return statement is misplaced. Will send a fix.

cc @stamblerre @ramya-rao-a

hyangah added a commit to hyangah/vscode-go-old that referenced this issue Apr 20, 2020
Also, update getMissingTools to check the tool's existence
by simply checking whether the resolved tool path is absolute.
getBinPath already ran the existence check before returning
the absolute path for the tool.

Fixes microsoft#3194
hyangah added a commit to hyangah/vscode-go-old that referenced this issue Apr 20, 2020
Also, update getMissingTools to check the tool's existence
by simply checking whether the resolved tool path is absolute.
getBinPath already ran the existence check before returning
the absolute path for the tool.

Fixes microsoft#3194
@rmuddana
Copy link

Is this the reason for code auto completion, code navigation (IntelliSense) is not working while using modules (go.mod)?
When i try with simple go file code suggestions and completion works however when i workspace with go.mod file it doesnt work.
I am using the latest build i.e 1.44.2 and the ms-vscode.go is 0.14.1

@hyangah
Copy link
Contributor

hyangah commented Apr 25, 2020

@rmuddana It's unlikely to be related. This bug affects only the gopls auto-upgrade functionality.

Please file a separate issue (remember to include the related settings (those starting with "go", "gopls", "[go]" prefixes), enough details to reproduce the issue, gopls version, and if possible, the gopls trace (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#vs-code)

ramya-rao-a pushed a commit that referenced this issue Apr 25, 2020
* src/goLanguageServer: fix missing gopls detection logic

Also, update getMissingTools to check the tool's existence
by simply checking whether the resolved tool path is absolute.
getBinPath already ran the existence check before returning
the absolute path for the tool.

Fixes #3194

* delete debug log message
@ramya-rao-a
Copy link
Contributor

The latest update 0.14.2 has the fix for this, Thanks @hyangah
And thanks for reporting @MorpheusXAUT

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants