1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:05:06 -07:00
go/internal/lsp
Suzy Mueller fc82fb2afd internal/lsp: return error when renaming within an import spec
Since renaming an identifier within an import spec is not yet supported,
return an error when this is encountered. These idents from the import
spec have a nil declaration object.

Import paths that contain '.' or '/' are caught by the valid identifier check
avoiding the crash, but import paths such as "fmt" are not as fmt is a
valid identifier. This change checks if i.decl.obj is nil and returns an error
if it is to avoid the crash.

Fixes golang/go#33768

Change-Id: I4e757b42bedffd648fc821590e4a383826200dc3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/191163
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-08-22 00:03:11 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp: unlabel context, log errors when canceled 2019-08-20 20:39:21 +00:00
cmd internal/telemetry: pass the http.Client to the ocagent 2019-08-21 16:29:14 +00:00
debug internal/telemetry: add the ability to flush telemetry data 2019-08-21 16:29:56 +00:00
diff internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
fuzzy internal/lsp: add fuzzy completion matching 2019-08-14 16:13:50 +00:00
protocol internal/telemetry: add the ability to flush telemetry data 2019-08-21 16:29:56 +00:00
snippet internal/lsp: introduce snippet builder object 2019-04-25 18:37:29 +00:00
source internal/lsp: return error when renaming within an import spec 2019-08-22 00:03:11 +00:00
telemetry internal/telemetry: extract units to their own package 2019-08-15 21:28:32 +00:00
testdata internal/lsp: return error when renaming within an import spec 2019-08-22 00:03:11 +00:00
tests internal/lsp: return error when renaming within an import spec 2019-08-22 00:03:11 +00:00
code_action.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
completion.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
definition.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
diagnostics.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
format.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
general.go internal/lsp: add completions of unimported std lib pkgs 2019-08-16 18:32:40 +00:00
highlight.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
hover.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
link.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
lsp_test.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
references.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
rename.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
reset_golden.sh internal/lsp: fix definition tests to use golden files 2019-05-10 21:06:55 +00:00
server.go internal/lsp: add completions of unimported std lib pkgs 2019-08-16 18:32:40 +00:00
signature_help.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
symbols.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
text_synchronization.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
util.go internal/lsp: separate out getMapper function 2019-08-16 20:05:58 +00:00
workspace.go internal/lsp: use x/xerrors to create new errors 2019-08-06 19:46:56 +00:00