ActivityWatch / ActivityWatch/aw-watcher-vim

Can't start watcher, weird channel errors? Data is 000

未关闭
#22 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Vim Script
星标
124
派生
14
PR 合并指标
30 天内没有已合并 PR

描述

I finally decided to activitywatch after only knowing about this project for 4 years.

I installed this plugin and needed to copy some of the configuration to my `vimrc`. Spoiler alert: I did this: `let g:aw_apiurl_host = 127.0.0.1`.

Fast forward two hours of me learning lots about the rest API of `aw-server`, jobs and vim channels, trying to debug why `curl -s http://127001/api/0/buckets//` wasn't working only to realise if you actually put `let g:aw_apiurl_host = 127.0.0.1` into your `vimrc` then you're gonna have a BAD time. `127.0.0.1` actually concatenates that into `127001` and doesn't throw an error like how I would it expect it to do. So that's a learning.

My own debug logs of this, the "channel data" is somehow `000`?
![logs](https://i.imgur.com/9NgwyNc.png)

Not sure what can be done with this, I tried to add some validation:

```vim
function! AWStart()
" :h types here
if type(s:apiurl_host) != 1
echoerr "g:apiurl_host must be a string!"
return
endif
if type(s:apiurl_port) != 0
echoerr "g:apiurl_host must be a number!"
return
endif
call s:CreateBucket()
endfunc

```

But since it's a string it passed my ad-hoc validation.

Naturally, I can blame the documentation: he said sarcastically, please don't hurt me

![readme](https://i.imgur.com/XJiQYn2.png)
Not sure what to make of this issue, but it hopefully makes someone that is having the same issue that might be searching github issues to find me in 2021 writing a post mortem 3 minutes to 1 am at a rainy wednesday night/morning.

Feel free to do whatever to this issue.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。