1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:14:45 -07:00
go/internal/lsp/source
Rob Findley 2350fe8b0e internal/lsp/source: fix panic in addFieldItems
I have no idea what I did to trigger this, but I got a panic in this
codepath. Since this is for completion, it should be OK to simply make
this code defensive, without fully understanding the cause.

Here's the panic:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xc570f3]

goroutine 5914644 [running]:
golang.org/x/tools/internal/lsp/source/completion.(*completer).addFieldItems(0xc0996ee240, 0x1032020, 0xc0dd21e2a0, 0xc0b99b26f0)
        /usr/local/google/home/rfindley/src/tools/internal/lsp/source/completion/completion.go:1065 +0x193

Change-Id: I82350b30172ead95b6611962c2e040cc49259dc2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254697
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-09-14 15:58:11 +00:00
..
completion internal/lsp/source: fix panic in addFieldItems 2020-09-14 15:58:11 +00:00
genopts gopls/doc: generate settings JSON, docs 2020-09-09 20:53:33 +00:00
call_hierarchy.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
code_lens.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
command.go internal/lsp: clean up some of the extract function code 2020-09-08 20:39:53 +00:00
comment_test.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
comment.go internal/lsp/source: use space character in markdown formatting 2020-08-26 03:44:07 +00:00
diagnostics.go internal/lsp: handle staticcheck in didChangeConfiguration 2020-09-13 03:21:22 +00:00
enums_string.go gopls/doc: generate settings JSON, docs 2020-09-09 20:53:33 +00:00
extract.go internal/lsp: clean up some of the extract function code 2020-09-08 20:39:53 +00:00
folding_range.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
format_test.go internal/lsp: reproduce and fix golang/go#41057 2020-09-02 22:40:51 +00:00
format.go gopls/doc: generate settings JSON, docs 2020-09-09 20:53:33 +00:00
gc_annotations.go internal/lsp: in gc_details change command to use a temporary file. 2020-08-11 15:37:30 +00:00
highlight.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
hover.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
identifier_test.go internal/lsp/source: add a unit test for searchForEnclosing 2020-07-28 18:51:24 +00:00
identifier.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
implementation.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
options_json.go internal/lsp/cache: automatically construct the workspace module 2020-09-11 04:00:25 +00:00
options.go internal/lsp: handle staticcheck in didChangeConfiguration 2020-09-13 03:21:22 +00:00
references.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
rename_check.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
rename.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
signature_help.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
source_test.go gopls/doc: generate settings JSON, docs 2020-09-09 20:53:33 +00:00
symbols.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
types_format.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
util.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
view.go internal/lsp: handle staticcheck in didChangeConfiguration 2020-09-13 03:21:22 +00:00
workspace_symbol_test.go internal/lsp/source: support some fzf-like tokens in symbol matching 2020-09-08 16:35:05 +00:00
workspace_symbol.go internal/lsp/source: fix duplicates in workspaceSymbols 2020-09-10 22:23:12 +00:00