Skip to content

x/tools/gopls: call to unexpected built-in type string (*types.TypeName) #65304

Not planned
@mitrabeast

Description

@mitrabeast

What did you do?

Each time I work with vscode and gopls server it needs 5 minutes to scan all the project no matter what the size it is. Then after some changes it takes 5 mins again to "save the file" if there are some syntax errors in it. It became impossible to work because of your inefficient software which doesn't have good alternatives except maybe paid ones. Please fix this issue its impossible to work!

What did you expect to see?

I expect it to work as fast as it possibly can. Not as fast as it works right now to make the code readable or clean or whatever your excuse for its current speed. Use some simd or assembly level optimization or rewrite it in C. I don't care. Its impossible to just load the project and work.

What did you see instead?

I see that it takes infinite amount of time to process a project and I need to restart gopls 100500 times each time I sit to work and to do my job.

Internal errors

Gopls detected 2 internal errors, 1 distinct:

  • /home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/source/signature_help.go:93 (2)
-- 2024-01-22 15:37:38.368401685 +0200 EET -- 
/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/source/signature_help.go:93: call to unexpected built-in type string (*types.TypeName) (1/2)

goroutine 2201541 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
golang.org/x/tools/gopls/internal/bug.report({0xc01b697000, 0x39})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/bug/bug.go:88 +0x118
golang.org/x/tools/gopls/internal/bug.Errorf({0xfb7aea?, 0xc0127dbc50?}, {0xc01a0e16c0?, 0xc01241f400?, 0xc00dbe99d0?})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/bug/bug.go:58 +0x35
golang.org/x/tools/gopls/internal/lsp/source.SignatureHelp({0x122aa08?, 0xc012b34090?}, {0x1239328?, 0xc01241f400?}, {0x122bc40, 0xc019dcc360}, {0x1516f200?, 0xc0?})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/source/signature_help.go:93 +0x839
golang.org/x/tools/gopls/internal/lsp.(*Server).signatureHelp(0xdd5040?, {0x122aa40, 0xc019d13860}, 0xc0195e9f50)
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/signature_help.go:25 +0x1fd
golang.org/x/tools/gopls/internal/lsp.(*Server).SignatureHelp(0xc006206200?, {0x122aa40?, 0xc019d13860?}, 0xdd5040?)
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/server_gen.go:268 +0x1d
golang.org/x/tools/gopls/internal/lsp/protocol.serverDispatch({0x122aa40, 0xc019d13860}, {0x123ce40, 0xc00026ae10}, 0xc0195e9f20, {0x122ac00, 0xc019e8bb80})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/protocol/tsserver.go:587 +0x3d29
golang.org/x/tools/gopls/internal/lsp/lsprpc.(*StreamServer).ServeStream.ServerHandler.func3({0x122aa40, 0xc019d13860}, 0xc0195e9f20, {0x122ac00, 0xc019e8bb80})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/protocol/protocol.go:157 +0x7e
golang.org/x/tools/gopls/internal/lsp/lsprpc.(*StreamServer).ServeStream.handshaker.func4({0x122aa40, 0xc019d13860}, 0xc0195e9f20, {0x122ac00?, 0xc019e8bb80?})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/lsprpc/lsprpc.go:521 +0x923
golang.org/x/tools/gopls/internal/lsp/protocol.Handlers.MustReplyHandler.func1({0x122aa40, 0xc019d13860}, 0xc01b64ae70, {0x122ac00?, 0xc019e8bb80?})
	/home/dima/go/pkg/mod/golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd/internal/jsonrpc2/handler.go:35 +0xe5
golang.org/x/tools/gopls/internal/lsp/protocol.Handlers.AsyncHandler.func2.2()
	/home/dima/go/pkg/mod/golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd/internal/jsonrpc2/handler.go:103 +0x96
created by golang.org/x/tools/gopls/internal/lsp/protocol.Handlers.AsyncHandler.func2 in goroutine 119
	/home/dima/go/pkg/mod/golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd/internal/jsonrpc2/handler.go:100 +0x1ed


-- 2024-01-23 16:27:53.082198629 +0200 EET -- 
/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/source/signature_help.go:93: call to unexpected built-in type string (*types.TypeName) (2/2)

goroutine 36451 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
golang.org/x/tools/gopls/internal/bug.report({0xc008f1af40, 0x39})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/bug/bug.go:88 +0x118
golang.org/x/tools/gopls/internal/bug.Errorf({0xfb7aea?, 0xc00815c150?}, {0xc0008076c0?, 0xc009055400?, 0xc00ec5fe00?})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/bug/bug.go:58 +0x35
golang.org/x/tools/gopls/internal/lsp/source.SignatureHelp({0x122aa08?, 0xc00b5f08d0?}, {0x1239328?, 0xc009055400?}, {0x122bc40, 0xc012f64a80}, {0x809a000?, 0xc0?})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/source/signature_help.go:93 +0x839
golang.org/x/tools/gopls/internal/lsp.(*Server).signatureHelp(0xdd5040?, {0x122aa40, 0xc00b1c9180}, 0xc00b5f07b0)
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/signature_help.go:25 +0x1fd
golang.org/x/tools/gopls/internal/lsp.(*Server).SignatureHelp(0xc00a952300?, {0x122aa40?, 0xc00b1c9180?}, 0xdd5040?)
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/server_gen.go:268 +0x1d
golang.org/x/tools/gopls/internal/lsp/protocol.serverDispatch({0x122aa40, 0xc00b1c9180}, {0x123ce40, 0xc0005111d0}, 0xc00b5f0780, {0x122ac00, 0xc00b5b1980})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/protocol/tsserver.go:587 +0x3d29
golang.org/x/tools/gopls/internal/lsp/lsprpc.(*StreamServer).ServeStream.ServerHandler.func3({0x122aa40, 0xc00b1c9180}, 0xc00b5f0780, {0x122ac00, 0xc00b5b1980})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/protocol/protocol.go:157 +0x7e
golang.org/x/tools/gopls/internal/lsp/lsprpc.(*StreamServer).ServeStream.handshaker.func4({0x122aa40, 0xc00b1c9180}, 0xc00b5f0780, {0x122ac00?, 0xc00b5b1980?})
	/home/dima/go/pkg/mod/golang.org/x/tools/gopls@v0.14.2/internal/lsp/lsprpc/lsprpc.go:521 +0x923
golang.org/x/tools/gopls/internal/lsp/protocol.Handlers.MustReplyHandler.func1({0x122aa40, 0xc00b1c9180}, 0xc00c25f0c8, {0x122ac00?, 0xc00b5b1980?})
	/home/dima/go/pkg/mod/golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd/internal/jsonrpc2/handler.go:35 +0xe5
golang.org/x/tools/gopls/internal/lsp/protocol.Handlers.AsyncHandler.func2.2()
	/home/dima/go/pkg/mod/golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd/internal/jsonrpc2/handler.go:103 +0x96
created by golang.org/x/tools/gopls/internal/lsp/protocol.Handlers.AsyncHandler.func2 in goroutine 24
	/home/dima/go/pkg/mod/golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd/internal/jsonrpc2/handler.go:100 +0x1ed

Build info

golang.org/x/tools/gopls v0.14.2
    golang.org/x/tools/gopls@v0.14.2 h1:sIw6vjZiuQ9S7s0auUUkHlWgsCkKZFWDHmrge8LYsnc=
    github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
    github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
    golang.org/x/mod@v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
    golang.org/x/sync@v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
    golang.org/x/sys@v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
    golang.org/x/telemetry@v0.0.0-20231114163143-69313e640400 h1:brbkEFfGwNGAEkykUOcryE/JiHUMMJouzE0fWWmz/QU=
    golang.org/x/text@v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
    golang.org/x/tools@v0.14.1-0.20231114185516-c9d3e7de13fd h1:Oku7E+OCrXHyst1dG1z10etCTxewCHXNFLRlyMPbh3w=
    golang.org/x/vuln@v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU=
    honnef.co/go/tools@v0.4.5 h1:YGD4H+SuIOOqsyoLOpZDWcieM28W47/zRO7f+9V3nvo=
    mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
    mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.21.1

Activity

added
ToolsThis label describes issues relating to any tools in the x/tools repository.
goplsIssues related to the Go language server, gopls.
on Jan 26, 2024
added this to the Unreleased milestone on Jan 26, 2024
changed the title [-]x/tools/gopls: Works incredibly slow each time I use it. FIX IT IT'S IMPOSSIBLE TO WORK[/-] [+]x/tools/gopls: Works incredibly slow each time I use it.[/+] on Jan 26, 2024
changed the title [-]x/tools/gopls: Works incredibly slow each time I use it.[/-] [+]x/tools/gopls: call to unexpected built-in type string (*types.TypeName)[/+] on Jan 26, 2024
dominikh

dominikh commented on Jan 26, 2024

@dominikh
Member

While I appreciate that gopls could be faster, your attitude is neither wanted nor tolerated here. We're not making you use gopls and as you correctly determined, you have alternatives that you can pay for; maybe people that get paid by you have a higher tolerance for abrasive behavior.

While the errors look real, I'd prefer it if someone who is more likely to cooperate in the debugging process filed an issue for those.

locked as too heated and limited conversation to collaborators on Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dominikh@gopherbot@mitrabeast

        Issue actions

          x/tools/gopls: call to unexpected built-in type string (*types.TypeName) · Issue #65304 · golang/go