Skip to content

Commit

Permalink
VIM: Update Go plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
artnez committed Feb 27, 2017
1 parent da5c2fd commit 3dcd2c7
Show file tree
Hide file tree
Showing 69 changed files with 3,657 additions and 1,326 deletions.
21 changes: 9 additions & 12 deletions packages/vim/dot/vim/bundle/go/.github/ISSUE_TEMPLATE.md
@@ -1,16 +1,14 @@
### Actual behavior
### Behavior

Write here what's happening ...

### Expected behavior

Write here what you're expecting ...
Write here what's happening and what you're expecting instead of...

### Steps to reproduce:

Please create a reproducible case of your problem. Re produce it
with a minimal `vimrc` with all plugins disabled and only `vim-go`
enabled:
Please create a reproducible case of your problem. If this step is
not provided, the issue will be **closed**

Re produce it with a minimal `vimrc` with all plugins disabled and
only `vim-go` enabled:

1.
2.
Expand All @@ -23,6 +21,5 @@ useful, such as:

* `vimrc` you used to reproduce
* vim version:
* vim-go version
* go version

* vim-go version:
* go version:
5 changes: 5 additions & 0 deletions packages/vim/dot/vim/bundle/go/.gitignore
@@ -1 +1,6 @@
doc/tags
.DS_Store

# Test specific files
FAILED
test.log
21 changes: 21 additions & 0 deletions packages/vim/dot/vim/bundle/go/.travis.yml
@@ -0,0 +1,21 @@
language: go

env:
global:
- DEPS=$HOME/deps
- PATH=$DEPS/bin:$PATH
- PATCH="v8.0.0134"

install: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
# check out if we can pre-compiled Vim releases somehow,
git clone --branch $PATCH --depth 1 https://github.com/vim/vim
cd vim
./configure --prefix=$DEPS --with-features=huge --disable-gui
make
make install
cd -
script: ./scripts/test.sh
217 changes: 214 additions & 3 deletions packages/vim/dot/vim/bundle/go/CHANGELOG.md
@@ -1,20 +1,232 @@
## Unplanned
## unplanned

FEATURES:

* New `:GoAddTags` and `:GoRemoveTags` command based on the tool [gomodifytags](https://github.com/fatih/gomodifytags). This fixes many old bugs that were due prior regexp based implementation. For the usage please read the docs and checkout the demo at: https://github.com/fatih/vim-go/pull/1204 [gh-1204]
* Add new `errl` snippet that expands to [gh-1185]:

```
if err != nil {
log.Fatal(err)
}
```

IMPROVEMENTS:

* Lowercase `<Leader>` in mappings examples for consisten documentation across the README [gh-1192]
* All of files should be written in utf-8 if the file will be passed to external command. [gh-1184]
* `:GoAddTags` is now able to add options to existing tags with the syntax `:GoAddTags key,option`, i.e: `:GoAddTags json,omitempty` [gh-985]
* Document 'noshowmode' requirement for echo_go_info [gh-1197]
* Improve godoc view for vertical splits [gh-1195]
* Set GOPATH for both possible go guru execution paths (sync and async) [gh-1193]

BUG FIXES:

* Honor `g:go_echo_command_info` when dispatching builds in neovim [gh-1176]
* Fix `:GoBuild` error in neovim due to invalid jobcontrol handler function signatures (`s:on_stdout`, `s:on_stderr`)[gh-1176]
* Update statusline before and after `go#jobcontrol#Spawn` command is executed [gh-1176]
* Correctly report the value of the 'g:go_guru_tags' variable [gh-1177]
* Ensure no trailing `:` exist in GOPATH detection if initial GOPATH is not set [gh-1194]
* Fix `:GoAddTags` to allow modifying existing comments [gh-984]
* Fix `:GoAddTags` to work with nested structs [gh-990]
* Fix `:GoAddTags` adding tags twice for existing tags [gh-1064]
* Fix `:GoAddTags` not working for fiels of types `interface{}` [gh-1091]
* Fix `:GoAddTags` not working for fields with one line comments [gh-1181]
* Fix `:GoAddTags` not working if any field comment would contain `{}` [gh-1189]
* Respect go_fmt_options when running goimports [gh-1211]
* Set the filename in the location-list when there is an error with :GoFmt [gh-1199]


## 1.11 - (January 9, 2017)

FEATURES:

* Travis test integration has been added. Now any file that is added as `<name>_test.vim` will be automatically tested in for every Pull Request (just like how we add tests to Go with `_test.go`). Going forward this will tremendously increase the stability and decrease the maintaince burden of vim-go. [gh-1157]
* Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [gh-1055]
* Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [gh-1124]

IMPROVEMENTS:

* Add `statusline` support for `:GoMetaLinter` [gh-1120]
* Quickfix and Location lists contain now a descriptive title (requires at least Vim `7.4.2200`)[gh-1004]
* Check `go env GOPATH` as well for `:GoInstallBinaries` as Go has now a default path for GOPATH ("~/go")starting with 1.8 [gh-1152]
* `:GoDocBrowser` now also works on import paths [gh-1174]

BUG FIXES:

* Always use full path to detect packages to be shown in statusline [gh-1121]
* Use `echom` to persist errors in case of multiple echos [gh-1122]
* Fix a race condition where a quickfix window was not closed if a job has succeeded [gh-1123]
* Do not expand coverage arguments for non job execution of `:GoCoverage` [gh-1127]
* `:GoCoverage` doesn't mess up custom syntax anymore [gh-1128]
* Disable autoformat for `asm` files as they might be non Go ASM format [gh-1141]
* Fix indentation broken when using a action with a minus sign like `{{-` [gh-1143]
* Fix breaking Neovim change of passing less arguments to callbacks [gh-1145]
* Fix `guru` commands if custom build tags were set [gh-1136]
* Fix referencing a non defined variable for async commands when bang (!) was used
* Fix `:GoDef` failing for a modified buffer if `hidden` was not set [gh-1132]
* Fix `:GoDefStack` to allow popping from jump list when buffer is modified [gh-1133]
* Improve internal defining of functions and referencing them for async operations [gh-1155]
* Fix `:GoMetaLinter` failing if `go_metalinter_command` is set. [gh-1160]
* Fix `:GoMetaLinter`'s `go_metalinter_deadline` setting for async mode [gh-1146]

BACKWARDS INCOMPATIBILITIES:

* The following syntax options are now disabled by default. If you're using them be sure to set them in your .vimrc [gh-1167]

```viml
g:go_highlight_array_whitespace_error
g:go_highlight_chan_whitespace_error
g:go_highlight_extra_types
g:go_highlight_space_tab_error
g:go_highlight_trailing_whitespace_error
```



## 1.10 (November 24, 2016)

FEATURES:

* **Vim 8.0 support!** This is the initial version to add Vim 8.0 based support to
all basic commands (check out below for more information). With time we'll
going to extend it to other commands. All the features are only enabled if
you have at least Vim 8.0.0087. Backwards compatible with Vim 7.4.x.
If you see any problems, please open an issue.

* We have now a [logo for vim-go](https://github.com/fatih/vim-go/blob/master/assets/vim-go.png)! Thanks to @egonelbre for his work on this.
* `:GoBuild`, `:GoTest`, `:GoTestCompile`, `:GoInstall` commands are now fully
async. Async means it doesn't block your UI anymore. If the command finished
it echoes the status. For a better experience use the statusline information
(more info below)

* `:GoCoverage` and `:GoCoverageBrowser` commands are fully async.
* `:GoDef` is fully async if `guru` is used as command.
* `:GoRename` is fully async .

* `:GoMetaLinter` is fully asnyc. Also works with the current autosave linting
feature. As a reminder, to enable auto linting on save either call
`:GoMetaLinterAutoSaveToggle` (temporary) or add `let
g:go_metalinter_autosave = 1` (persistent) to your virmc).

* All `guru` commands run asynchronously if Vim 8.0 is being used. Current
Commands:
* GoImplements
* GoWhicherrs
* GoCallees
* GoDescribe
* GoCallers
* GoCallstack
* GoFreevars
* GoChannelPeers
* GoReferrers

* `:GoSameIds` also runs asynchronously. This makes it useful especially for
auto sameids mode. In this mode it constantly evaluates the identifier under the
cursor whenever it's in hold position and then calls :GoSameIds. As a
reminder, to enable auto info either call `:GoSameIdsAutoToggle`(temporary)
or add `let g:go_auto_sameids = 1` (persistent) to your vimrc.

* `:GoInfo` is now non blocking and works in async mode if `guru` is used in
`g:go_info_mode`. This makes it useful especially for autoinfo mode. In this
mode it constantly evaluates the identifier under the cursor whenever it's in
hold position and then calls :GoInfo. As a reminder, to enable auto info
either call `:GoAutoTypeInfoToggle`(temporary) or add `let
g:go_auto_type_info = 1` (persistent) to your vimrc. To use `guru` instead of
`gocode` add following to your vimrc: `let g:go_info_mode = 'guru'`

The `guru` is more accurate and reliabed due the usage of `guru` describe. It
doesn't rely on `pkg/` folder like `gocode` does. However it's slower than
`gocode` as there is no caching mechanism in `guru` yet.

* **New**: Statusline function: `go#statusline#Show()` which can be plugged into
the statusline bar. Works only with vim 8.0. It shows all asynchronously
called functions status real time. Checkout it in action:
https://twitter.com/fatih/status/800473735467847680. To enable it add the
following to your `vimrc`. If you use lightline, airline, .. check out their
respective documentation on how to add a custom function:

```viml
" go command status (requires vim-go)
set statusline+=%#goStatuslineColor#
set statusline+=%{go#statusline#Show()}
set statusline+=%*
```

IMPROVEMENTS:

* **:GoDocBrowser** is now capable to to understand the identifier under the cursor (just like :GoDoc)
* Function calls are now highlighted as well when `g:go_highlight_functions` is enabled [gh-1048]
* Add completion support for un-imported packages. This allows to complete even
if the package is not imported. By default it's disabled, enable by adding
`let g:go_gocode_unimported_packages = 1` [gh-1084]
* Tools that embeds GOROOT into their binaries do not work when people update
their Go version and the GOROOT contains the vesion as part of their path
(i.e: `/usr/local/Cellar/go/1.7.2/libexec`, [more
info](https://blog.filippo.io/stale-goroot-and-gorebuild/)) . This is now
fixed by introducing automatic GOROOT set/unset before each tool invoke.
[gh-954]
* Added new setting `g:go_echo_go_info` to enable/disable printing identifier
information when completion is done [gh-1101]
* Added new `go_echo_command_info` setting is added, which is enabled by
default. It's just a switch for disabling messages of commands, such as
`:GoBuild`, `:GoTest`, etc.. Useful to *disable* if `go#statusline#Show()` is
being used in Statusline, to prevent to see duplicates notifications.
* goSameId highlighting is now linked to `Search`, which is much more clear as
it changes according to the users colorscheme
* Add plug mapping `(go-lint)` for :GoLint [gh-1089]


BUG FIXES:

* Change back nil and iota highlighting color to the old type [gh-1049]
* Fix passing arguments to `:GoBuild` while using NeoVim [gh-1062]
* Do not open a split if `:GoDef` is used on a modified file [gh-1083]
* Highlight nested structs correctly [gh-1075]
* Highlight builtin functions correctly if `g:go_highlight_functions` is enabled [gh-1070]
* Fix `:GoSameIds` highlighting if a new buffer is opened in the same window [gh-1067]
* Internal: add `abort` to all vim function to return in case of errors [gh-1100]
* Fix `:GoCoverage` to be executed if working dir is not inside the test dir [gh-1033]

BACKWARDS INCOMPATIBILITIES:

* remove vim-dispatch and vimproc.vim support. vim 8.0 has now the necessary
API to invoke async jobs and timers. Going forward we should use those. Also
this will remove the burden to maintain compatibility with those plugins.

* `go#jobcontrol#Statusline()` is removed in favor of the new, global and
extensible `go#statusline#Show()`

## 1.9 (September 13, 2016)

IMPROVEMENTS:

* **guru** uses now the `-modified` flag, which allows us use guru on modified
buffers as well. This affects all commands where `guru` is used. Such as
`:GoDef`, `:GoReferrers`, etc.. [gh-944]
* **:GoDoc** uses now the `-modified` flag under the hood (for `gogetdoc), which allows us to get documentation for the identifier under the cursor ina modified buffer. [gh-1014]
* Cleanup and improve documentation [gh-987]
* Add new `g:go_gocode_socket_type` setting to change the underlying socket type passed to `gocode`. Usefull to fallback to `tcp` on cases such as Bash on Windows [gh-1000]
* `:GoSameIds` is now automatically re-evaluated in cases of buffer reloads (such as `:GoRename`) [gh-998]
* Improve docs about `go_auto_sameids` [gh-1017]
* Improve error message by printing the full path if an incompatible `goimports` is being used [gh-1006]
* `iota` and `nil` are now highlighted correctly and are not treated as booleans [gh-1030]

BUG FIXES:

* Fix system calls on Windows [gh-988]
* Fix :GoSameIds and :GoCoverage for light background and after changing color schemes [gh-983]
* Fix TagBar and `GoCallers` for Windows user [gh-999]
* Set updatetime for for `auto_sameids` feature as well [gh-1016]
* Update docs about missing `go_highlight_generate_tags` setting [gh-1023]
* Fix updating the jumplist if `:GoDef` is used [gh-1029]
* Fix highlighting literal percent sign (`%%`) in strings [gh-1011]
* Fix highlighting of nested fields [gh-1007]
* Fix checking for `exepath` feature for the upcoming vim 8.0 release [gh-1046]

BACKWARDS INCOMPATIBILITIES:

* Rename `GoMetalinterAutoSaveToggle` to `GoMetaLinterAutoSaveToggle` to make it compatible with the existing `:GoMetaLinter` command [gh-1020]

## 1.8 (July 31, 2016)

Expand All @@ -23,7 +235,7 @@ FEATURES:
* The snippet expansion `json` is now much more smarter. It pre populates the placeholder according to the first word and it also applies `snake_case` or `camelCase` conversion. Together with `:GoAddTags` it gives `vim-go` users flexible ways of populating a field tag. Checkout the demo to see it in action: https://twitter.com/fatih/status/754477622042689536 [gh-927]
* New **`:GoSameIds`** command. When called highlights all same identifiers in the current file. Can be also enabled to highlight identifiers automatically (with `:GoSameIdsAutoToggle` or `g:go_auto_sameids`). Checkout the demo to see it in action: https://twitter.com/fatih/status/753673709278339072. [gh-936]
* New **`:GoWhicherrs`** command. It shows all possible values of the selected error variable. [gh-948]
* Add new `errp` snippet to expand an `if err != nil { panic() }` clause [gh-926]
* Add new `errp` snippet to expand an `if err != nil { panic() }` clause [gh-926]
* If you open a new buffer with a Go filename it get automatically populated based on the directory. If there are no Go files a simple main package is created, otherwise the file will include the package declaration line based on the package in the current directory. Checkout the demo to see it in action: https://twitter.com/fatih/status/748333086643994624. This is enabled by default. Can be disabled with `let g:go_template_autocreate = 0`. You can use your own template with `let g:go_template_file = "foo.go"` and putting the file under the `templates/` folder. [gh-918]
* Added new toggle commands to enable/disable feature that run for your
automatic. For example if you have `let g:go_auto_type_info = 1` enabled, you
Expand Down Expand Up @@ -173,4 +385,3 @@ BACKWARDS INCOMPATIBILITIES:
## Previous releases

Previous changelogs can be found here: https://github.com/fatih/vim-go/releases

4 changes: 3 additions & 1 deletion packages/vim/dot/vim/bundle/go/LICENSE
Expand Up @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software includes some portions from Go. Go is used under the terms of the
BSD like license.

Expand Down Expand Up @@ -56,3 +56,5 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The Go gopher was designed by Renee French. http://reneefrench.blogspot.com/ The design is licensed under the Creative Commons 3.0 Attributions license. Read this article for more details: https://blog.golang.org/gopher
7 changes: 7 additions & 0 deletions packages/vim/dot/vim/bundle/go/Makefile
@@ -0,0 +1,7 @@
all: test

test:
@echo "==> Running tests"
@./scripts/test.sh

.PHONY: all test

0 comments on commit 3dcd2c7

Please sign in to comment.