1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00
go/internal/lsp/mod
Rohan Challa 136c3617b6 internal/lsp: support textDocument/formatting for .mod extension
This change implements support for textDocument/formatting when it comes to go.mod files. It also adds formatting on save ability.

To enable formatting on save for go.mod files, you need to include the following settings inside of your VSCode settings.json:

...
"[go.mod]": {
	"editor.codeActionsOnSave": {
		"source.organizeImports": true,
	},
	"editor.formatOnSave": true,
},
...

Updates golang/go#36501

Change-Id: I60ac14d0e99b2b086fe9a8581770771aafc2173c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/221223
Run-TryBot: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-03-06 13:51:27 +00:00
..
testdata/unchanged internal/lsp/tests: fix reset of golden files 2020-02-19 14:42:13 +00:00
code_lens.go internal/lsp: add an upgrade all dependencies codelens 2020-03-02 21:30:18 +00:00
diagnostics.go internal/span,lsp: disambiguate URIs, DocumentURIs, and paths 2020-02-14 22:51:03 +00:00
format.go internal/lsp: support textDocument/formatting for .mod extension 2020-03-06 13:51:27 +00:00
hover.go internal/lsp: support textDocument/hover for .mod extension 2020-02-26 15:59:49 +00:00
mod_test.go internal/lsp: move the debug.Instance onto the Context 2020-03-03 22:54:53 +00:00