1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:08:36 -06:00
Commit Graph

3752 Commits

Author SHA1 Message Date
Daved
18e3458ac9 cmd/present: fix origin mismatch for websocket when using HTTPS
Fixes golang/go#31328

Change-Id: Ib190f42970d5b203e3f1fbf997aa896cf624bf91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/171118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-14 20:52:21 +00:00
Michael Matloob
539cdc44f8 go/packages: temporarily disable some tests running on go tip with -race
A change in go/types has uncovered a race in go/packages. While we debug,
ignore those tests when running on tip with -race to make the builders
green. This change will be reverted as soon as the issue is fixed.

Updates golang/go#31749

Change-Id: I96f0b30a1bc203a5c36a2ce30c943583b7f8035a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200819
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-10-14 17:20:00 +00:00
Rebecca Stambler
b53505e708 internal/lsp: cache analysis using memoize package
This change moves to the approach of caching the analysis using the
memoize package. This means that we will do less work, as we no longer
need to recompute results that are unchanged. The cache key for an
analysis is simply the key of the CheckPackageHandle, along with the
name of the analyzer.

Change-Id: I0e589ccf088ff1de5670401b7207ffa77a254ceb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200817
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-14 17:19:42 +00:00
Shengjing Zhu
5fa5b1782b gopls/doc: instructions for adding settings in coc.nvim
Change-Id: I7d69477cc103e8e45b0e9394e32945a0d8ee19b3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200868
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-14 14:15:50 +00:00
Peter Weinberger
8de300cfc2 internal/lsp/protocol: handle case of an otherwise empty notification
Some notifications, like exit, have no other arguments, a case the code
was not handling correctly.

Change-Id: Ib5ff536352ba6ad0d09cd80c9d5f0a987abbe500
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200298
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Peter Weinberger <pjw@google.com>
2019-10-12 15:20:04 +00:00
Michael Matloob
4c025a95b2 go/packages: make a copy of the config.Env slice in the test.
Before this change, we were "saving" config.Env and then appending
to it to create a new slice, like so:

  savedEnv := config.Env
  ...
  // for each test case
    config.Env = append(savedEnv, additionalValue)

but we're modifying savedEnv during each env. Even though it might
work, it's not doing what we expect. Clean this up.

Change-Id: Idcf8199d836241df2b934308863512c566c0c485
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200769
Run-TryBot: Michael Matloob <matloob@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-11 21:18:36 +00:00
Emmanuel T Odeke
7667e13ae9 internal/telemetry: modify *Subscriber to take timeAt
Modifies the various Subscriber signatures to take in
an "at" time.Time field, which captures the time that
a measurement was made. This field will then be used
when exporting points as their EndTime.

Fixes #34490.

Change-Id: I9e87b65e374876ae3d4df0abedb64bb7dcb221b6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199577
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-11 20:42:57 +00:00
Muir Manders
59731289e9 internal/lsp: include context in go/packages config
Include the context when invoking go/packages.Load so it is
cancelable. Otherwise if the user is manually typing an import or
otherwise messing around with imports, a big queue of potentially very
slow go/packages.Load calls will build up.

Fixes golang/go#34414.

Change-Id: I80732086b478b908c720739708dd773e81fe2b81
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200058
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-11 19:56:53 +00:00
Rebecca Stambler
638914d249 internal/lsp: return an error from {Narrowest,Widest}CheckPackageHandle
This will prevent us from panicking in cases with errors.

Fixes golang/go#34824

Change-Id: I02c20655f6926ec00c1591a905ff5a107cc44192
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200300
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-11 16:51:06 +00:00
Ian Cottrell
5889748991 internal/lsp: use options hooks to install diff driver
Change-Id: I2f94c2a68d0036a47ccac3fce07cf9f3b784d443
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200558
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-11 16:38:31 +00:00
Ian Cottrell
17d4c77023 internal/lsp: fix unified diffs of edits at the end of a file
Change-Id: I3a7db9261f0bc16609af6d58b363ec52474cb07e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200697
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-11 16:38:14 +00:00
Ian Cottrell
2c43fbf27d internal/lsp: fix test failures caused by diff algorithm variance
Fixes golang/go#34833

Change-Id: I7f8c1d3214914af40a8b9c3532f9a0a6e17246c0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200557
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-11 16:37:56 +00:00
Ian Cottrell
e5ffc44a6f internal/lsp: remove edit fixups from rename now diff is functional
Change-Id: I9b26388abe4b1470605852c71c397c7fddf7fdef
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199740
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-10 20:19:05 +00:00
Ian Cottrell
a26de0c301 gopls: use go-diff for edit generation
this supports sub-line diffs and is much faster

Fixes golang/go#33003
Fixes golang/go#32586
Updates golang/go#31937

Change-Id: I02f82c75828e7e3ec804e8beee916893d4c14b3d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/191018
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-10 20:18:25 +00:00
Ian Cottrell
7025dca8be internal/lsp: expand edits to whole lines in ToUnified
We don't want to support sub line edits or non line context in the unified diff
printing.

Change-Id: I4267b11b50f12d817dac0fbbae7e1db44ca3dad0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199739
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-10 20:14:46 +00:00
Ian Cottrell
6ac766747f internal/lsp: merge diffing test data sets
also improve the actual verification of the unified diff

Change-Id: I9c23c24e1fc8571cce2a7879463659ec7069fe99
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199738
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-10 20:13:25 +00:00
Ian Cottrell
7822de7a2d internal/lsp: fix patch tests on builders
Fixes golang/go#34620

Change-Id: Id8e2310c27d5697a8988b9e8dc85be979f9b8d40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199737
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-10-10 20:12:59 +00:00
Jay Conrod
8abd424004 internal/imports: skip TestModeGetmodeVendor
Test is broken by recent cmd/go vendoring changes. Skipping the test
case while we figure out what to do.

Updates golang/go#34826

Change-Id: I31a6f18e40420970251e25836edcf32c56c10ef5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200299
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-10-10 17:12:13 +00:00
Nathan Dias
0337d82405 ocagent: convert Int64Data and Float64Data metrics to *wire.Metric.
Histogram data still needs to be converted and
timestamps are not attached as they are not yet available.

What works:

* convertMetric will now convert Int64Data and Float64Data.

What does not work yet:

* Histogram64Int and Histogram64Float will still not be converted.
* StartTime and EndTime will not be attached to timeseries and points.
* MetricDescriptors will not have a unit attached.
* no labels will be attached to timeseries.

Updates golang/go#33819

Change-Id: I65f9af716ba6282e809d0a9d10777d70475e4c83
GitHub-Last-Rev: 10820a9971e1f4c0529fadc567b2533256c2e961
GitHub-Pull-Request: golang/tools#170
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199857
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
2019-10-10 07:50:00 +00:00
Brad Fitzpatrick
b090f1f240 go/analysis/passes/asmdecl: remove amd64p32 support
Updates golang/go#30439

Change-Id: I46c7de8d16c3470f2f20a4d0e03b74bb38c8aff0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199500
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-10-09 21:34:38 +00:00
Ian Cottrell
6536af71d9 internal/span: end of file is now last line +1
We already accepted it as a valid input, but for output we still produced
last_line,last_column+1
Also add package docs and improve error messages

Change-Id: I017aa326e8392134e67e8fabec47e750c8055454
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199641
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-07 18:54:44 +00:00
Agniva De Sarker
79dbfd6c86 cmd/godoc: update findGOROOT
After godoc stopped being part of the Go distribution, the location
of the godoc binary and the go binary can be different. Hence the old
GOROOT finding logic does not work anymore.

We shell out to "go env GOROOT" to return the new GOROOT.

Fixes golang/go#23445

Change-Id: I16e4c0798e3f5cda13d9f6546cf82808a10c4a0b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199279
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-07 18:40:23 +00:00
Rebecca Stambler
944452d4f0 internal/lsp: stop cluttering logs with highlight errors
We used to return an error from textDocument/highlight if the cursor
wasn't over an identifier. Logging these errors is not useful, as the
cursor is often not on an identifier.

Change-Id: Ibb43908149315c72923a22bdca567aa2b3ee68d8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199640
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-07 17:20:23 +00:00
Panos Georgiadis
83b12cb08e Fix vscode config to watch file changes
Fix the documentation by using the correct configuration for
watching file changes outside of the editor.

Fixes https://github.com/microsoft/vscode-go/issues/2810

Change-Id: Ib550d9831fe4563ceb5917d9196b201a03b051d2
GitHub-Last-Rev: 86c49abed8a0c79b641e02a23128b4654d2d6d48
GitHub-Pull-Request: golang/tools#169
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199578
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-07 17:02:13 +00:00
Dan Kortschak
af92b0ef1f godoc/vfs/zipfs: fix godoc formatting
Change-Id: I0303e362e82b713823b46247d15baa2ff6f6a344
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199617
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-07 15:17:16 +00:00
Ian Cottrell
c9f9432ec4 internal/lsp: clean up ApplyEdits
This should be a faster but equivalent implementation.

Change-Id: I7bc756644c601b953ba7715e093bfa10ca5ea97b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198878
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-05 01:44:04 +00:00
Ian Cottrell
5bee6a6eb8 internal/lsp: cleanup the diff package
Make sure everything is documented and move things to sensible files now all the
cross package shuffling is done

Change-Id: I884053a207d6741cda066afa5da91b00f1dfd31c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198877
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-05 01:43:51 +00:00
Michael Matloob
43d3a2ca2a go/packages: update tests to reflect changes in golang.org/cl/198459
That change changes the name of an ad-hoc package go list produces
to contain the names of the files instead of just being called
"command-line-arguments". It also means go list will report multiple
packages for an ad-hoc package that's not saved on disk that contains
multiple sources.

Update test cases that depend on this behavior.

One thing to be aware of: the change in go list (without additional
changes in go/packages) will break users depending on ad-hoc
packages with multiple files, when the any of the  files don't exist
on disk. We're not adding a work-around in this cl because overlays
aren't guaranteed to be 100% correct and the LSP doesn't need this
functionality. If this turns out to be a problem we can fix it.

Change-Id: I342cd3cb54bf35992186ee02ddd9ac316ff1db4f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199097
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-04 21:17:43 +00:00
Matts966
d89860af3b go/analysis/analysistest: fix nil pointer dereference when sorting facts
Without this change, we can't use `ExportPackageFact` function with analysistest package.

PackageFacts are keyed by nil and analysistest.check crashed while sorting, due to a nil object dereference.

Change-Id: Ic94c71acc9c74012bf150e1d72e937da8dfdff75
GitHub-Last-Rev: 51c91008a6756e66c630bfeabc9b8da08c12bfdd
GitHub-Pull-Request: golang/tools#163
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196758
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-10-04 19:10:47 +00:00
jaap aarts
27eeabb020 internal/lsp: convert comments to markdown before sending to client
This converts all the comments from golang doc syntax to popper markdown.

Fixes #34161

Change-Id: If513100170e7d8c159bfa93b0d1e36d293e9872f
GitHub-Last-Rev: 093f82e6ad8567b3e41bcf5daf14e9c0b5832015
GitHub-Pull-Request: golang/tools#165
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197760
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
2019-10-04 18:35:38 +00:00
Rebecca Stambler
b22818684c go/internal/gcimporter: support Go versions < 1.11
Fixes golang/go#34689

Change-Id: I7ab6c5a00c24a188b2dbd75160091cf6c834bd6a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199037
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-10-04 18:21:43 +00:00
Rebecca Stambler
72853e10c5 go/internal/gcimporter: handle the possibility of a nil fileset
This panic was found by running the gopherjs tests:
https://circleci.com/gh/gopherjs/gopherjs/1767.

Change-Id: Ica97f31d20bbbd541b40ae3fd17594238883706a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198857
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-10-04 05:50:02 +00:00
Ian Cottrell
88641d98b3 internal/lsp: cleanup the diff/myers package
The only exposed symbol is now the ComputeEdits function, all other functionality
is now moved up to the diff layer and using edits instead of operations.

Change-Id: I149e4f3276592e1a7c2c52e6eaffc826cc22a9fa
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198518
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-04 03:45:34 +00:00
Ian Cottrell
cc9bfb3eec internal/lsp: rewrite the unified diff handling
It is now in the diff package written in terms of edits, instead of the myers package.
This also means that the unified handling is no longer pluggable because it does
not need to be.

Change-Id: I7141b023e95ed0c1d21cbc81c7420c117fc5ef1a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198517
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-04 03:45:17 +00:00
Ian Cottrell
db1ebf78a8 internal/lsp: move unified diff testing to the diff interface
This now checks at the diff.TextEdit layer rather than  myers.Op

Change-Id: I706657a6c5705f0ad7109aa81f4dce174dda5f2b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198380
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-04 03:44:59 +00:00
Ian Cottrell
b917058f11 internal/lsp: invert the diff dependencies so myers depends on diff
This makes it so the diff package is depended on by all implementations, rather
than the diff package having to depend on the default myers implementation.

Change-Id: I04b9caee6ff1017fa8e5476a7434e4b0e17753c3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198379
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-04 02:16:33 +00:00
Ian Cottrell
6e0078a899 internal/lsp: allow the diff alorithm to be specified per view
Change-Id: Ib9d44d2012253189f87bc3b15a88b400f76ae955
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198378
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-04 02:16:33 +00:00
Rebecca Stambler
246a69f4f1 go/gcexportdata: use IExportData when writing gcexportdata
Updates golang/go#28260

Change-Id: Id0ef98e1599fbef4dd67ba23c20ddb8bc4d33228
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198742
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-10-04 02:16:33 +00:00
Rebecca Stambler
9901302c21 internal/lsp: use dependencies in cache keys
This change includes dependencies in the cache keys for
CheckPackageHandles. This should fix the issue with propagating results
to reverse dependencies.

Updates golang/go#34410

Change-Id: I025b7f0d6b0dcaa89c3461ebd94eadd35de4955f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198317
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-04 02:16:33 +00:00
Ian Cottrell
f7bb6f12f0 internal/lsp: do not allow diff.ApplyEdits to be replaced
We only need one implementation of this, it must cope with all inputs, and it
has no freedom in it's results, so it does not need to be pluggable.

Change-Id: I6fec0c339eb288649a670fc3e2cb00c726467e20
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198377
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-04 02:16:33 +00:00
Muir Manders
91543147e3 internal/lsp: restore "IsIncomplete" completion flag
Looks like I dropped this line accidentally after resolving a merge
conflict. I restored the original code checking the "deep" option in
addition to my intended drive-by fix of also checking the "fuzzy"
option. In either case the client should not cache completion
candidates.

Change-Id: I586daa28e3e4e4cc64665ba507245be4e91b08f2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198490
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-04 02:16:33 +00:00
Rebecca Stambler
f0a16743a2 internal/lsp: address staticcheck warnings
Change-Id: I67c689d31b61425b1eec8b4719e906ce26777759
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198441
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-04 02:16:23 +00:00
Muir Manders
87e6e099c6 internal/lsp: don't overwrite suffix when inserting completion
In cases like "fmt.Pr<>int()" we previously would replace "Print" with
the new completion, yielding for example "fmt.Println()". Now we no
longer overwrite, yielding "fmt.Println()int()". There are some cases
where overwriting the suffix is what the user wants, but it is hard to
tell, so for now stick with the more expected behavior of not
overwriting.

Fixes golang/go#34011.

Change-Id: I8c3ccd8948245c27b52408ad508d8e01dc163ef4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196119
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-02 20:07:45 +00:00
Fazlul Shahriar
8a18b87bf6 all: fix broken links to LSP specification
Change-Id: Ied2cfa57012a8ec3c8bdd03a97fa7fc8bc744be9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198381
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-02 18:32:53 +00:00
Dmitri Shuralyov
3769738f41 blog: add support for optional analytics HTML
This change makes it possible for users of the blog package
to provide analytics HTML, which can then be inserted on pages.

Previously, this was possible by making ad-hoc modifications
to the template files. It's easier to have a dedicated field.

Change-Id: Id7c24dc9c7b5b9e23d18f3987f2f1af27c709681
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198323
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-02 16:18:51 +00:00
Rebecca Stambler
329c8d646e internal/lsp: delete unused code
Change-Id: Ifda9ebcd3fdbb7457b9b46380e238a6fe0081015
Reviewed-on: https://go-review.googlesource.com/c/tools/+/198258
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-01 18:41:21 +00:00
Denis Isaev
4414aad16c go/ssa: make a setNumable interface
Workaround crash on go/ssa in go < 1.13.
See https://github.com/golang/go/issues/29612.

Change-Id: I32687f6ee0baaf223248d5c1631663c73cbbfc65
GitHub-Last-Rev: 6bf28bf927cff6d53bcfaf199701e5451d17305e
GitHub-Pull-Request: golang/tools#162
Reviewed-on: https://go-review.googlesource.com/c/tools/+/195477
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2019-10-01 17:08:58 +00:00
Rebecca Stambler
57610eddc9 internal/lsp: rework snapshots and cache FileHandles per-snapshot
This change does not complete the work to handle snapshots correctly,
but it does implement the behavior of re-building the snapshot on each
file invalidation.

It also moves to the approach of caching the FileHandles on the snapshot,
rather than in the goFile object, which is now not necessary.

Finally, this change shifts the logic of metadata invalidation into the
content invalidation step, so there is less logic to decide if we should
re-load a package or not.

Change-Id: I18387c385fb070da4db1302bf97035ce6328b5c3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197799
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-10-01 16:26:22 +00:00
Peter Weinberger
8b695b21ef internal/lsp/protocol: generate correct log messages for 'exit' notifications
The log code left out the case where a notification had no parameters at all.

Change-Id: I1d832edb7b7e85422ef6baba1e05286e69dd0cde
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197724
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-01 12:34:49 +00:00
Jay Conrod
7c411dea38 godoc/vfs: fix union logic in NameSpace.ReadDir
ReadDir now returns files from directories in all matching mount
points if no Go files are present in any of them. The behavior now
matches the documentation.

Fixes golang/go#34571

Change-Id: I3a0c8d49a5906ec33ebe9e3efea9d2b9d267506c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197801
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-09-30 20:11:59 +00:00