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

x/tools/gopls: crash in adjustRangeForCommentsAndWhiteSpace #55271

Closed
suzmue opened this issue Sep 20, 2022 · 2 comments
Closed

x/tools/gopls: crash in adjustRangeForCommentsAndWhiteSpace #55271

suzmue opened this issue Sep 20, 2022 · 2 comments
Assignees
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@suzmue
Copy link
Contributor

suzmue commented Sep 20, 2022

gopls version: (devel) (go1.19.1)
gopls flags: -rpc.trace
update flags: proxy
extension version: 0.35.2
go version: 1.19.1
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Tue, 20 Sep 2022 17:55:50 GMT
restart history:
Tue, 20 Sep 2022 17:53:55 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

panic: runtime error: index out of range [1] with length 1

goroutine 2418 [running]:
golang.org/x/tools/gopls/internal/lsp/source.adjustRangeForCommentsAndWhiteSpace({0xc003478540, 0x6f8735, 0x6f8737}, 0xc003478540, {0xc00032d500, 0x505, 0xa80}, 0xc0023f2b80)
	  extract.go:679  0x774
golang.org/x/tools/gopls/internal/lsp/source.CanExtractFunction(0xc003478540, {0xc003478540, 0x6f8735, 0x6f8737}, {0xc00032d500, 0x505, 0xa80}, 0xc0023f2b80)
	  extract.go:984  0x1d3
golang.org/x/tools/gopls/internal/lsp.extractionFixes({0x2123898, 0xc00065c100}, {0x212d3c0, 0xc000002140}, {0x212b730, 0xc0004ea600}, {0xc001e1e360, 0x28}, {{0x22, 0xa}, ...})
	  code_action.go:306  0x5f8
golang.org/x/tools/gopls/internal/lsp.(*Server).codeAction(0xc000480360, {0x2123898, 0xc00065c100}, 0xc001bc8000)
	  code_action.go:201  0x2dc8
golang.org/x/tools/gopls/internal/lsp.(*Server).CodeAction(0xc000480360, {0x2123898, 0xc00065c100}, 0xc001bc8000)
	  server_gen.go:16  0x95
golang.org/x/tools/gopls/internal/lsp/protocol.serverDispatch({0x2123898, 0xc00065c100}, {0x2131160, 0xc000480360}, 0xc0009c8000, {0x2123c50, 0xc00065c040})
	  tsserver.go:239  0x492d
golang.org/x/tools/gopls/internal/lsp/protocol.ServerHandler.func1({0x2123898, 0xc00065c100}, 0xc0009c8000, {0x2123c50, 0xc00065c040})
	  protocol.go:157  0x14e
golang.org/x/tools/gopls/internal/lsp/lsprpc.handshaker.func1({0x2123898, 0xc00065c100}, 0xc0009c8000, {0x2123c50, 0xc00065c040})
	  lsprpc.go:515  0xeae
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0x2123898, 0xc00065c100}, 0xc001a76318, {0x2123c50, 0xc00065c040})
	  handler.go:35  0x152
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2()
	  handler.go:103  0xc3
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x2cc
[Error - 1:55:27 PM] 

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Sep 20, 2022
@gopherbot gopherbot added this to the Unreleased milestone Sep 20, 2022
@suzmue suzmue self-assigned this Sep 20, 2022
@findleyr
Copy link
Contributor

Thanks for following up!

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.10.0 Sep 20, 2022
@gopherbot
Copy link

Change https://go.dev/cl/432135 mentions this issue: gopls: fix out of bounds bug in extract

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants