1
0
mirror of https://github.com/golang/go synced 2024-10-01 12:48:33 -06:00
go/internal/span
Paul Jolly 72ffa07ba3 internal/span: handle character values beyond end of line in FromUTF16Column
On the assumption these implementations are designed to
support/implement the LSP spec, FromUTF16Column should handle the case
where a character value is beyond the end of the line.

https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#position:

> * If the character value is greater than the line length it defaults back to the
> * line length.

Fixes golang/go#31883

Change-Id: I370845b7f2f046d8e84048a26bae5b23e9c27d06
Reviewed-on: https://go-review.googlesource.com/c/tools/+/185058
Run-TryBot: Paul Jolly <paul@myitcv.org.uk>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-07-06 07:08:13 +00:00
..
parse.go internal/span: change to private fields 2019-03-15 18:05:47 +00:00
span_test.go internal/span: change to private fields 2019-03-15 18:05:47 +00:00
span.go internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
token111.go internal/span: adding a source location package to unify the pos conversions 2019-03-08 14:21:31 +00:00
token112.go internal/span: adding a source location package to unify the pos conversions 2019-03-08 14:21:31 +00:00
token_test.go internal/span: change to private fields 2019-03-15 18:05:47 +00:00
token.go internal/span: catch potential panics in go/token 2019-06-27 17:21:57 +00:00
uri_test.go internal/span: handle empty paths correctly 2019-06-11 15:43:01 +00:00
uri.go internal/span: improve invalid uri message 2019-06-13 16:13:34 +00:00
utf16_test.go internal/span: handle character values beyond end of line in FromUTF16Column 2019-07-06 07:08:13 +00:00
utf16.go internal/span: handle character values beyond end of line in FromUTF16Column 2019-07-06 07:08:13 +00:00