Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved type for all standard Go types and functions #2918

Open
Samyoul opened this issue Mar 16, 2018 · 8 comments
Open

Unresolved type for all standard Go types and functions #2918

Samyoul opened this issue Mar 16, 2018 · 8 comments

Comments

@Samyoul
Copy link

Samyoul commented Mar 16, 2018

  • Plugin version (or commit hash): 0.12.1799

  • IDE name and version: Intellij IDEA 2016.2.5

  • Java version: 8

  • OS name and version: Windows 10 Pro

  • What happens?

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
Copy link
Member

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

@Samyoul
Copy link
Author

Samyoul commented Mar 16, 2018

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

@dlsniper
Copy link
Member

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
Copy link
Author

Samyoul commented Mar 16, 2018

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
Copy link

siredwin commented Jun 1, 2018

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
Copy link

Albert-W commented Sep 4, 2018

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
Copy link

emasean commented Sep 27, 2018

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
Copy link

zoxpx commented Jul 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants