GHC 2018-09-30

3 comments.

, https://git.io/fxJtb in jarun/googler
No problem. More detailed explanation of autoloaded functions in Zsh, if you're unfamiliar with the concept: http://zsh.sourceforge.net/Doc/Release/Functions.html#Autoloading-Functions. Also, check out http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Autoloaded-files (or `man zshcompsys`) for autoloading in the context of the completion system, how the `#compdef` tag works, how `compinit`, `compaudit` (you'll need to deal with this when directories in `$fpath` have wrong permissions) and co. operate, etc.

, https://git.io/fxJkM in rust-lang-nursery/rls-vscode
No "Run test" lens when test #[should_panic]
============================================

A screenshot should explain it:

<img width="506" alt="screen shot 2018-09-30 at 3 44 21 pm" src="https://user-images.githubusercontent.com/4149852/46261885-dc65df80-c4c7-11e8-92cc-b0f3505abde5.png">

The upper `#[test]` has the "Run test" lens, while the lower `#[test] #[should_panic]` does not. Would be nice to support the `#[should_panic]` case too.

CC @matklad who implemented this lens.

(rls-vscode v0.4.10)

, https://git.io/fxfh4 in jarun/googler
Sorry, but `_googler` the file is the body of the `_googler` function, i.e., the file is basically a `_googler () { ... }` enclosure. It should be autoloaded, not sourced. All you need to do is leave the file in `$fpath`. This is the way zsh completions are and should be written most of the time; check out [the builtin completion defs](https://github.com/zsh-users/zsh/tree/master/Completion/).

What you're doing here is redefining `_googler` as another function within the original `_googler` function (the first time it is called). Your current version is also wrong: on the first call you only redefined the function, but never called it. This is of course okay if you're sourcing, and you probably don't want execution when you're sourcing, but point is you shouldn't be sourcing. There are completion defs written this way, but they are structured as

```zsh
_googler () {
    ...
}

_googler "$@"
```

and it's pretty redundant.

I don't use zplug, but again, if you're sourcing the completion def, you're probably doing it wrong. Add the directory to `$fpath` instead.