go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 570 forks source link

Unresolved type for all standard Go types and functions #2918

Open Samyoul opened 6 years ago

Samyoul commented 6 years ago

Auto complete and error checking don't work correctly, all of the standard Go primitive types and functions are not recognised.

Have I made an error with the set up of this plugin?

package client

import (
    "context"
    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/ethclient"
    "github.com/ethereum/go-ethereum/rpc"
    "log"
    "math/big"
    "strconv"
)

type Client struct {
    handlesErrors bool
    EtherClient   *ethclient.Client
    RpcClient     *rpc.Client
}

func Dial(rawUrl string, handlesErrors bool) (*Client, error) {
    // Make connection to Ethereum client
    ethClient, err := ethclient.Dial(rawUrl)
    // TODO Handle errors in handler
    if err != nil {
        log.Fatalf("Failed to connect to the Ethereum network: %v", err)
    }

    // Make connection to the RPC client
    newRpcClient, err := rpc.Dial(rawUrl)
    // TODO Handle errors in handler
    if err != nil {
        log.Fatalf("Failed to connect to the Ethereum network: %v", err)
    }

    return &Client{
        handlesErrors: handlesErrors,
        EtherClient:   ethClient,
        RpcClient:     newRpcClient,
    }, err
}

inkedscreenshot 2018-03-16 15 21 46_li

dlsniper commented 6 years ago

Unfortunately this project is no longer maintained, I highly recommend you switch to GoLand

Samyoul commented 6 years ago

This would mean I would need to have 2 IDEs. I thought Intellij IDEA Ultimate was the one stop IDE.

dlsniper commented 6 years ago

Then you can use IntelliJ IDEA Ultimate 2017.3+, it has the Go functionality of GoLand. But you are using a very old version of IDEA as is and this project, as I've mentioned, is no longer maintained.

Samyoul commented 6 years ago

According to the README https://github.com/go-lang-plugin-org/go-lang-idea-plugin#release-versions-schema the plugin version I am using is compatible with the IDEA version. So it seems unlikely that the problem is related to my IDE version, or the plugin version.

Plugin version number Platform number
0.12.x IntelliJ 2016.2 (IntelliJ IDEA 2016.2)
0.11.x IntelliJ 2016.1 (IntelliJ IDEA 2016.1)
0.10.x IntelliJ 143.1180 - 143.9999 (IntelliJ IDEA 15.0.2+)
0.9.x IntelliJ 141.1532 - 141.9999 (IntelliJ IDEA 14.1)
siredwin commented 6 years ago

I am on Linux and this plugin works till Golang version 1.9.6. 1.10+ won't work and gives the unresolved type error on import. It could be the same with Windows but I am not sure. Eventually, I think the way to go is to use Goland.

Albert-W commented 6 years ago

Hi, I upgrade the IDEA from 2017.2 to 2018.2 , and the problem is solved. When I upgrade the IDEA, than I can upgrade the go plugins to 182.4129..... I think this is the problem.

emasean commented 6 years ago

Was on Go1.9 and upgraded to Go1.11 since MacOS 10.14 Mojave required it, now my combination of IntelliJ IDEA CE 2017.1 and Go plugin (the last known working combination) stop to work.

zoxpx commented 5 years ago

Take a look at https://github.com/go-lang-plugin-org/go-lang-idea-plugin/blob/master/src/com/goide/project/GoVendoringUtil.java#L31 .. the code is taking only first 3 characters from sdkVersion, treating your go-v1.11.4 as go-v1.1. A "quick hack" is to edit the $HOME/.Idea*/config/options/jdk.table.xml and downgrade your Go-SDK versions to v1.9.