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

875 Commits

Author SHA1 Message Date
Ian Cottrell
625c92e46d internal/lsp: have tests report a different application name to the main gopls binary
Change-Id: I246dc9c468ee35586a8332ebdf41f23521adbc6c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/186677
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-07-18 23:01:26 +00:00
Jean de Klerk
fefcef05ab digraph: refactor allpaths to print an adjacency list
Refactors allpaths to print an adjacency list from "from" to "to", instead of
just the nodes. This allows other tools like modgraphviz to print the subgraph.
For example, the following command:

    cd $GOPATH/src/cloud.google.com/go && \
    go mod graph | \
    digraph allpaths cloud.google.com/go golang.org/x/text@v0.3.2 | \
    modgraphviz | \
    dot -Tpng -o graph.png

Generates the following graph.png: https://user-images.githubusercontent.com/3584893/60481727-df0a8680-9c4b-11e9-8df9-c581d599edd1.png

Also splits out the allpaths tests into their own test, and adds many test
cases.

This is a breaking change. The previous behavior returned vertices; now it
returns edges. If you relied on the previous behavior, use:

    my-application | digraph allpaths <from> <to> | digraph nodes

Change-Id: I2eb7c377f5fe1e1e90c5b74eaa78d5211192bb2a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184337
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-07-16 02:13:16 +00:00
Jean de Klerk
2868181328 digraph: clean up docs, usage, copyright
- Move verbose usage docs to godoc, replace usage with terse description of
usage and commands.
- Add copyrights.
- Update usage to more canonical function format instead of const format.

Change-Id: I30d072f391bbf9911798e90efb85cd5351d99205
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184177
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-07-10 18:46:09 +00:00
Johan Brandhorst
44aeb8b7c3 cmd/present: correct function reference.
A previous change introduced a new way of storing
which page should be synced with the notes, but
used the wrong function name. This corrects the
function reference.

Fixes golang/go#32902

Change-Id: Iefbb189eae12f0d53e46e6f42d3526302515cab3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184737
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-07-02 20:17:34 +00:00
Daniela Petruzalek
a101b041de cmd/present: use unique key for destSlide in local store
We use a 'destSlide' entry in the local storage to keep presentation
and notes in sync while using '-notes' flag. This caused a name
collision if we had different presentations open at the same time.

This changes the 'destSlide' key in local storage to
'destSlide:<presentation-url>' to avoid collisions between different
presentations.

Fixes golang/go#24688

Change-Id: I4833fa83856a96b5978c09ed7e4360484ba4f109
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178659
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-06-24 22:21:33 +00:00
Ian Cottrell
10539ce303 cmd/gopls: preparing for v0.1.0
Change-Id: I6b749858cbba0ec300caa77426ba0ae69a97677d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/181997
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-06-12 23:17:17 +00:00
Brad Fitzpatrick
7be61e1b0e cmd/splitdwarf: fix skip on Windows
Unify the two files rather than have to maintain two copies of the
+build line.

Fixes golang/go#32212

Change-Id: I1f9ee4956183aa6248a5a2e83b5760d02532bacb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178699
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2019-05-25 14:57:41 +00:00
Ian Cottrell
7927dbab1b internal/lsp: build the packages config on demand from proper configuration
This moves the fileset down to the base cache, the overlays down to the session
and stores the environment on the view.
packages.Config is no longer part of any public API, and the config is build on
demand by combining all the layers of cache.
Also added some documentation to the main source pacakge interfaces.

Change-Id: I058092ad2275d433864d1f58576fc55e194607a6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178017
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-05-21 17:12:43 +00:00
Heschi Kreinick
0133cac317 cmd/goimports: reuse cached state
The internal imports API allows the user to control the lifetime of
caches, via the ProcessEnv object. Change the goimports command to use
the same cache for its lifetime. This should speed up goimports -w *.go
dramatically in cases where imports need to be added.

Change-Id: I01e3531ad53b038896435474ac9a8be97d5f3c10
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175448
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-20 21:49:40 +00:00
Ian Cottrell
b9584148ef internal/lsp: add structured layers to the cache
This is primarily to separate the levels because they have different cache
lifetimes and sharability.
This will allow us to share results between views and even between servers.

Change-Id: I280ca19d17a6ea8a15e48637d4445e2b6cf04769
Reviewed-on: https://go-review.googlesource.com/c/tools/+/177518
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-05-16 21:30:38 +00:00
Austin Clements
e31d36578a compilebench: handle missing MemStats more gracefully
Reporting MemStats requires the legacy profile format (see golang/go#18641).
This CL detects when it couldn't get the MemStats from the profile and
reports this, rather than reporting 0 allocs.

Change-Id: Ib621ad975290cf05835fafa81e8e47762d82a519
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175802
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:10 +00:00
Austin Clements
60140f0909 compilebench: add a linker benchmark
This links cmd/compile, which is the largest binary in GOROOT.

Unfortunately, this can't measure the linker's allocation metrics
prior to CL 176057 because the fix for golang/go#18641 was applied to
the compiler but not the linker.

Change-Id: Ia44d80f1d727c1608cedaa4b8ad2a05903774875
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175801
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:08 +00:00
Austin Clements
eeb76a0c47 compilebench: factor running build tool commands
We do a lot of sophisticated things around running the compile command
to gather benchmark metrics from it. We're about to add a benchmark
for the linker and will want all of the same mechanism. This CL
factors this out into a function.

Change-Id: I499d15d30417618f372982404ceb3e0f9c762e5c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175800
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:07 +00:00
Austin Clements
8a42e17289 compilebench: clean up different benchmark types
compilebench contains three different types of benchmarks and we're
about to add a fourth. Currently we dispatch based on name. This CL
cleans this up so the list of benchmarks points to how to run each
benchmark. It also joins together common error-reporting paths.

Change-Id: Icd4f77bdda9776863792dcd85f27b17829a833e6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175799
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:06 +00:00
Brad Fitzpatrick
9d4d845e86 cmd/goimports: add -format-only flag
Fixes golang/go#31745

Change-Id: I127ca4140c9db7df224b1892c43c457ac6edd646
Reviewed-on: https://go-review.googlesource.com/c/tools/+/174326
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-29 23:13:29 +00:00
LE Manh Cuong
681f9ce8ac cmd/compilebench: update document
Add document for "-go" and "-short" flag, which are listed in output of
"compilebench help".

Also reformat "-pkg" document to align with the rest.

Change-Id: I8ce80d8e02a9cf2b94aa099aa34e53412210d61b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170237
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2019-04-11 18:01:16 +00:00
Tobias Klauser
7e5bf9270d cmd/getgo: fix build on aix
Change-Id: Ic4a2f8f32258b14354658af5a09c736404d38808
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170961
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-10 13:57:22 +00:00
Rebecca Stambler
719e078ade cmd/gopls/integration/vscode: log diagnostics as they are received
This change will allow us to investigate golang/go#30786 more easily.
Diagnostics are getting stuck even though they appear to be being sent
in the correct order, so it will be helpeful to see what's happening on
the VSCode side.

Change-Id: I623fcd9979c05decb0a6f60da2f75af7d0ff3853
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170895
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-04-06 23:58:00 +00:00
Bryan C. Mills
052fc3cfdb cmd/auth/cookieauth: add a GOAUTH implementation that reads from a cookiefile
Updates golang/go#26232

Change-Id: Ic8a7336eeb395fb9e8bbb7589a98a402deed0501
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161669
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:40 +00:00
Bryan C. Mills
aafdb068a0 cmd/auth/netrcauth: add a reference GOAUTH implementation using .netrc files
Updates golang/go#26232

Change-Id: Ic6e0003be518e37927a25552b23da4f62eb1072d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161668
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:24 +00:00
Bryan C. Mills
e32fe8a1b3 cmd/auth/gitauth: add a reference GOAUTH implementation using 'git credential fill'
Updates golang/go#26232

Change-Id: Ic22722756df1e66551222a8834a152519cb39e24
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161667
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:12 +00:00
Bryan C. Mills
50503db0be cmd/auth/authtest: add a manual-test harness for GOAUTH implementations
Updates golang/go#26232

Change-Id: Idd6d32f4fcb99172a31e50fbd5993d563839c530
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161666
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:07 +00:00
Roger Peppe
63e6ed9258 cmd/stringer: compile error when constants change
When constant values change but stringer has not
been run again, we can get misleading string values.
Protect against this by generating code that will fail
with a compiler error when this happens.
Most compilers should be smart enough to omit the
code containing the checks.

Change-Id: I7a36d20f014cba0e7d88851d1b649a098ee30d76
Reviewed-on: https://go-review.googlesource.com/c/tools/+/163637
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2019-03-18 00:52:22 +00:00
Brad Fitzpatrick
658e28e1e6 cmd/stringer: add temporary(?) fix to get stringer test working in module mode
Updates golang/go#30874

Change-Id: I170ea99b3f06c8bc4cc624e86b80eeb852ea7115
Reviewed-on: https://go-review.googlesource.com/c/tools/+/167771
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-15 20:35:58 +00:00
Josh Bleecher Snyder
4ccd092f47 cmd/compilebench: generate separate mem profiles when using -count
When the -count flag is provided,
instead of having each run overwrite the previous profile,
add a count suffix to the profile filename.

Then you can combine the profiles with

go tool pprof `go tool -n compile` <all profile files here>

This was done for CPU profiles in https://golang.org/cl/39718.

Change-Id: I4aa66d745fe18088655fc1d9cf3ecf29f68370bb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/166523
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2019-03-14 00:31:01 +00:00
Dmitri Shuralyov
bd17c084df godoc/env: replace with golangorgenv
This change replaces the env package with a new golangorgenv package.

The previous env package existed primarily to configure the godoc
instance that was running golang.org. By now, the golang.org website
has been factored out to x/website, which has its own env package,
but ends up still using this env package indirectly via x/tools/godoc.

The goal of this change is to make env available for other services
that run on subdomains of golang.org, so they can continue to safely
rely on the x/tools/playground, which will be modified in the next
commit to also use the new golangorgenv.

The golangorgenv package replaces the IsProd function with a more
specific one. Start using it in packages x/tools/{,cmd}/godoc. Also,
re-arrange the order of checks to give the host suffix check higher
priority than the environment variable check. This way, if the
environment variable isn't set, the host suffix check gets a chance
to run.

When getting the value of "X-AppEngine-Country" header, use its
canonical format "X-Appengine-Country" to avoid an allocation.
This does not change behavior.

Updates golang/go#30486

Change-Id: I97b47211a45ca0351f31fcb4fa6d408a4b0c4c7c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/165459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-07 16:39:06 +00:00
Elias Naur
ab489119c5 cmd/godoc,cmd/gorename,refactor/rename: skip tests on GOOS=android
Change-Id: I7a493ba4c41dddb3049a8e62198d87749fb72f62
Reviewed-on: https://go-review.googlesource.com/c/tools/+/165719
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-06 15:27:20 +00:00
Gordon Tyler
2dc4ef2775 cmd/guru: fix guessImportPath for Windows
Import paths in Go use forward slashes, not the operating system's path separator.

Fixes golang/go#24699.
Fixes golang/go#23318.

Change-Id: I190224f6b7236e8ee19893f3589dd9686cbf116a
GitHub-Last-Rev: 751b29ca5f2e52ee1124c4baca6e45eecf4a3052
GitHub-Pull-Request: golang/tools#56
Reviewed-on: https://go-review.googlesource.com/c/151057
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-02-25 23:45:24 +00:00
Rebecca Stambler
69f75a3b06 cmd/golsp: remove golsp binary, since we've moved to gopls
We left the golsp binary for a few weeks after migrating to gopls.
Remove it now.

Change-Id: Iad44a3c9cf1427be6e2d81cc7a8e9fc60ef6ee50
Reviewed-on: https://go-review.googlesource.com/c/163779
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-02-25 22:51:37 +00:00
Dmitri Shuralyov
b4f3f03986 cmd/godoc: remove golang.org serving code
The code to serve the golang.org website has been moved to
the golang.org/x/website sub-repository. x/website has become
the canonical source of the golang.org website as of CL 162157,
and so this code can be removed from here now.

This has the benefit of removing some external dependencies
that were only used by the website in production mode, and
in turn enabling x/tools to be a smaller tools-related module.

In future changes, the golang.org/x/tools/cmd/godoc command
will be reduced in scope to be a tool for serving Go package
documentation only, not the rest of the golang.org website.

Run go mod tidy (using Go 1.12 RC 1).

Updates golang/go#29206
Updates golang/go#29981

Change-Id: I61fd25627d0506901b04688dea8d8c9da9fe8f04
Reviewed-on: https://go-review.googlesource.com/c/162400
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Channing Kimble-Brown <channing@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
2019-02-20 19:02:57 +00:00
Rhys Hiltner
f000d56b39 cmd/godoc: fix -url flag, add tests
This change adds a small number of integration tests for the godoc
command's -url flag, confirming that the behavior matches the local http
server tests in those cases. It fixes three bugs which prevent the -url
flag from working currently.

Fixes golang/go#30259
Fixes golang/go#30260
Fixes golang/go#30261

Change-Id: I0ca1fe81f9f186d0ca02b31674cc8654af434e92
Reviewed-on: https://go-review.googlesource.com/c/162907
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-19 13:52:30 +00:00
Dmitri Shuralyov
0a7d439b5f cmd/godoc: re-add documentation for flat presentation mode
The documentation of the "flat" presentation mode was removed
inadvertently as part of post-CLI-removal documentation cleanup
in CL 143077. The FlatDir flag still exists and is supported.
This change re-adds it to cmd/godoc documentation.

Also fix a typo in the "src" presentation mode description.

Updates golang/go#25443

Change-Id: If4705d70bc5eafee92cdfd52409aca4606a0efd7
Reviewed-on: https://go-review.googlesource.com/c/162984
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-19 03:57:21 +00:00
Ian Cottrell
44bee7e801 internal/lsp: changing server noun to serve verb
Also adding in --remote support and using it to implement the equivalent
functionality of the external forward command
Also adding in --listen as a replacement for --port as it is more flexible,
specifically it allows localhost:port which
is helpful in environments where opening remotely accesible ports is
problematic.

Change-Id: I5de1cea7dd6f1ee46e7423f3be2a4caca6f040b2
Reviewed-on: https://go-review.googlesource.com/c/161658
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-02-11 22:49:14 +00:00
Jonathan Amsterdam
b2f7fe607d cmd/stringer: type check using export data
Use go/packages to find and type check packages using export data.

In addition to type checking with export data, this should also enable
cmd/stringer to work correctly when using go modules.

jba: took over CL, tweaked package.Config use.

Change-Id: Ie253378b52fbd909f7194dfd09c039aab63dd8f0
Reviewed-on: https://go-review.googlesource.com/c/126535
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-02-04 22:01:59 +00:00
Rebecca Stambler
d810ce9e47 cmd/guru: remove Go 1.9 handling, since we no longer support 1.8
Some tests were split off for Go 1.9, when we still supported Go 1.8.
This change recombines them and removes the special handling for 1.9.

Fixes golang/go#24421

Change-Id: Ic871f4c3af4bb90b00cdd6d7b8f3253783554535
Reviewed-on: https://go-review.googlesource.com/c/161000
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2019-02-04 19:56:32 +00:00
Rebecca Stambler
51e363b66d internal/lsp: implement diff for computing text edits
Rather than replacing the whole file on gofmt or goimports, use the Myers
diff algorithm to compute diffs for a file. We send those back as text
edits.

Change-Id: I4f8cce5b27d51eae1911049ea002558a84cdf1bf
Reviewed-on: https://go-review.googlesource.com/c/158579
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-02-01 23:18:25 +00:00
Brad Fitzpatrick
0e05534988 cmd/tip: delete
The cmd/tip program moved to x/build (along with its history) in:

  https://go.googlesource.com/build/+/63986c177d1ff5d2629840f6b00c445f1cb932bf

(There's no associated Gerrit CL; the merge commit of x/build's old
HEAD + a git-filter-branch of x/tools's cmd/tip was pushed directly to
Gerrit's git server, without creating Gerrit CLs for review for each
commit in its history)

Updates golang/go#29981

Change-Id: I16b9b1b0079e3d7b6851cb3e7322a878ece73e23
Reviewed-on: https://go-review.googlesource.com/c/160817
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-01 18:59:10 +00:00
Michael Matloob
3c4dfba64b cmd/heapview: delete
This is all dead code that never went anywhere.

Change-Id: I79db05d6391709bb9ae3d86f557246f1dd3b21f7
Reviewed-on: https://go-review.googlesource.com/c/159957
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-28 22:39:01 +00:00
Andrew Bonventre
d66bd3c5d5 cmd/godoc: add x/xerrors redirect
Change-Id: I367caa5f8c90e53768b07427248ed2bcc83a58e3
Reviewed-on: https://go-review.googlesource.com/c/159739
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-25 23:20:54 +00:00
Ian Cottrell
78ee07aa94 cmd/gopls/integration: git ignore temporary vscode files
Change-Id: I9585fb227f44c4bf8071247bb6b89b6fed6cf83b
Reviewed-on: https://go-review.googlesource.com/c/159277
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-01-24 00:41:07 +00:00
tell-k
85a87a81a9 cmd/present: fix CSS when printing slides
The existing CSS style was causing slides to not align with page
boundaries when printing slides. The cause of that is the CSS transform
property that is applied to automatically scale size of slides.
This change clears the transform property just before printing.

Fixes golang/go#29480

Change-Id: I6f719ad1b716e9bda8ba83007c3d1d7dece9ce08
GitHub-Last-Rev: d46dfee57601b2e9127c5e8e80e596dc2a2f24fa
GitHub-Pull-Request: golang/tools#67
Reviewed-on: https://go-review.googlesource.com/c/155940
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-23 18:36:29 +00:00
Dmitri Shuralyov
9279ec27fd cmd/tip: also fetch x/net repository before building cmd/godoc
x/tools/cmd/godoc uses at least one Go package from x/net as of
CL 157197.

Don't add it to signature because we don't want the signature to
change whenever new commits to x/net are pushed, causing tip.golang.org
to be redeployed. This is because x/net is not considered a critical
component of the website at this time, and that's not expected to
change soon.

When the website begins using modules, it will specify the x/net
version precisely and this decision will no longer matter.

Fixes golang/go#29874

Change-Id: I1fa76bb81f8d2ffc2314375e2dfe4898c3af58de
Reviewed-on: https://go-review.googlesource.com/c/158937
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-23 02:11:25 +00:00
Rebecca Stambler
b258f6da23 cmd/gopls: rename "golsp" to "gopls", as in "Go Please"
Change-Id: Ie5688759ce21bffa6745eb86ef3606639e3ce335
Reviewed-on: https://go-review.googlesource.com/c/158197
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-01-16 23:16:16 +00:00
Rebecca Stambler
fc1d57b08d cmd/golsp: add a debugging tool to connect with golsp on a port
This change allows golsp to be run on a port, with an intermediary
command passing the data through. This allows for improved logging.
Also, add necessary changes to VSCode integration to allow changing the
name of the command for golsp.

Change-Id: I20dca1a50296636e57e022342ee70f0610ad1531
Reviewed-on: https://go-review.googlesource.com/c/157497
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-01-11 21:44:48 +00:00
David Chase
d30e00c240 splitdwarf: initial working commit
splitdwarf osxMachoFile [ osxDsymFile ]

splitdwarf takes an executable produced by go build as input,
and uncompresses and copies the DWARF segment into a separate
file in the way that is expected by OSX-hosted tools
(lldb and ports of gdb).
If osxDsymFile is not named explicitly, the default of
"<osxMachoFile>.dSYM/Contents/Resources/DWARF/<osxMachoFile>"
is used instead, with directories created as needed.

If the input file contains no UUID, then one is created by
hashing non-DWARF segment contents, and added to the
executable. This is necessary because gdb and lldb both
expect matching UUIDs to be present in the executable
and its debugging symbols.

Includes a modified version of debug/macho, with additional
definitions and the ability to write segments, sections, and
some MachO load commands added.

Change-Id: Ia5b0e289260f72bbca392cdf2c7c0a75e3ca40e5
Reviewed-on: https://go-review.googlesource.com/c/143357
Reviewed-by: Austin Clements <austin@google.com>
2019-01-09 16:56:30 +00:00
David Chase
d674b4ad67 cmd/splitdwarf: copy debug/macho
The splitdwarf command will need a modified version of debug/macho.
This is a verbatim copy from std as of Go 1.11, which we'll modify in
the next CL.

Change-Id: Ia9ded870d1ba91dad21f9f6dc5bb38f9f6cc0e80
Reviewed-on: https://go-review.googlesource.com/c/152240
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: David Chase <drchase@google.com>
2019-01-09 16:55:59 +00:00
Dmitri Shuralyov
9ea1c200b2 cmd/godoc: add x/website redirect
Add a redirect for the recently created x/website subrepository.

It's not yet included at https://golang.org/pkg/#subrepo because it's
in development. Once development reaches the point that x/website
is the canonical location of the golang.org server, we can consider
including x/website at https://golang.org/pkg/#subrepo (just like
x/blog, x/tour, x/build are already included there).

Updates golang/go#29206

Change-Id: I6889c1f5e40f11abca944b217a7354f76c08c8eb
Reviewed-on: https://go-review.googlesource.com/c/156337
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-04 17:33:42 +00:00
Iskander Sharipov
ca9055ed7d cmd/guru: fix incorrect case order in describe.go
Since *ast.CommClause implements ast.Stmt, type switch for
it would never execute in the original code, it will always
execute ast.Stmt branch.

Moving concrete types before interfaces help in this case.

Change-Id: Id84f2f7f3fac859029155d8e6debf4a8ef170b26
Reviewed-on: https://go-review.googlesource.com/c/153397
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-01-02 21:33:36 +00:00
Rob Pike
92cdcd90bf godoc: choose a smaller-output example as help when there are unexpected arguments
Change CL 153869 added a help message when there are leftover arguments,
as that used to invoke the command-line interface that is now gone.
But the example in the help text (go doc -all net/http) generates a huge
amount of output.

Use a very simple, small-output example instead, to illustrate how to
solve the problem without scrolling the program description hundreds
of screenfuls away.

Change-Id: I1887af1f3e853bf3a852dc374746074f1cd39441
Reviewed-on: https://go-review.googlesource.com/c/155157
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-12-20 02:49:03 +00:00
Filippo Valsorda
88e3b261f2 cmd/godoc: print a helpful error if used for command-line docs
The command-line interface was recently removed in favor of "go doc".

Change-Id: Idfcfca3b2eafaf63148a2ed88d4d25c61d9e3c69
Reviewed-on: https://go-review.googlesource.com/c/153869
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-12-19 18:50:13 +00:00