Giter Site home page Giter Site logo

deoplete-khard's Introduction

deoplete-khard

deoplete-khard offers asynchronous completion of email addresses using khard contacts stored in a carddav server. Inspired by deoplete-abook.

Installation

To install deoplete-khard, use your favorite Neovim plugin manager.

Using vim-plug

Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}
Plug 'nicoe/deoplete-khard'

deoplete-khard's People

Contributors

cbarrete avatar jorsn avatar nicoe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

nelyah jorsn

deoplete-khard's Issues

A recent khard change breaks deoplete-khard

A recent khard release removes get_email_addresses(), which breaks deoplete-khard.

I filed ticket #217, but it's just a plea for stable APIs as the removal looks intentional. In any case deoplete-khard is broken; since I can't find any explanation about why the method was released, I have no idea what's supposed to replace it.

Config has no attribute get_all_address_books

Autocomplete has stopped working, maybe due to a library change resulting from a system upgrade. It was working until about a week ago; I didn't have time to pull together this ticket until now.

  1. Open nvim
  2. :set ft=mail
  3. Enter: To: M
  4. Result:
[deoplete] Traceback (most recent call last):
  File "/home/ser/.config/nvim/pack/packages/start/deoplete.nvim/rplugin/python3/deoplete/ch
ild.py", line 179, in _gather_results
    result = self._get_result(context, source)
  File "/home/ser/.config/nvim/pack/packages/start/deoplete.nvim/rplugin/python3/deoplete/ch
ild.py", line 234, in _get_result
    ctx['candidates'] = source.gather_candidates(ctx)
  File "/home/ser/.config/nvim/pack/packages/start/deoplete-khard/rplugin/python3/deoplete/s
ources/khard_emails.py", line 33, in gather_candidates
    self.__fill_cache()
  File "/home/ser/.config/nvim/pack/packages/start/deoplete-khard/rplugin/python3/deoplete/s
ources/khard_emails.py", line 39, in __fill_cache
    for addressbook in khard_config.get_all_address_books():
AttributeError: 'Config' object has no attribute 'get_all_address_books'
Error from khard: AttributeError("'Config' object has no attribute 'get_all_address_books'")
.  Use :messages / see above for error details.

deoplete.nvim and deoplete-khard are installed using vim pack; that is, the repositories are cloned into ~/.config/nvim/pack/packages/start/.... As I said, this has been working fine since I installed it, ad the layout hasn't changed.

deoplete.nvim

commit a2019e9f4f764a48a96a75e96b1b4f0bb79b4827 (HEAD -> master, origin/master, origin/HEAD)
Author: Shougo Matsushita [email protected]
Date: Thu Jan 10 11:15:43 2019 +0900

deoplete-khard

commit 6c1f758 (HEAD -> master, origin/master, origin/HEAD)
Author: Nicolas Evrard [email protected]
Date: Sun Jun 3 23:01:07 2018 +0200

nvim

NVIM v0.3.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.3.3/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

checkhealth

health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - OK: Python3.5+ was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='5402'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 0ms
  - INFO: $TERM: screen-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Multiple python2 executables found.  Set `g:python_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python2
  - INFO: Other python executable: /bin/python2
  - INFO: Python version: 2.7.15
  - INFO: pynvim version: 0.3.1
  - OK: Latest pynvim is installed.

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.7.2
  - INFO: pynvim version: 0.3.1
  - OK: Latest pynvim is installed.

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v11.6.0
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

Help to set up the plugin

Hi,

I am new to deoplete, so I am not totally sure how to set up everything to make deoplete-khard work.

Everything is installed correctly, so I guess I am missing something in the nvim configuration file.

After :set filetype=mail, I start writing an email, but after writing something like To: Fran nothing happens, even there are a lot of Franks in my khard vcards. After <c-x><c-o> the result is:

-- Omni completion (^O^N^P) Pattern not found

I would need some help to make it work. Thanks in advance!

Best,
Jaime

deoplete-khard stopped working...

Hi,

The last couple of days I've started getting this error:

[deoplete] Traceback (most recent call last):                                                                                                                       
  File "/home/kf/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results
    result = self._get_result(context, source)
  File "/home/kf/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result
    ctx['candidates'] = source.gather_candidates(ctx)
  File "/home/kf/.config/nvim/plugged/deoplete-khard/rplugin/python3/deoplete/sources/khard_emails.py", line 33, in gather_candidates
    self.__fill_cache()
  File "/home/kf/.config/nvim/plugged/deoplete-khard/rplugin/python3/deoplete/sources/khard_emails.py", line 39, in __fill_cache
    for vcard in khard.get_contacts(
  File "/usr/lib/python3.8/site-packages/khard/khard.py", line 451, in get_contacts
    raise ValueError('sort must be "first_name", "last_name" or '
ValueError: sort must be "first_name", "last_name" or "formatted_name" not False.
Error from khard: sort must be "first_name", "last_name" or "formatted_name" not False..  Use :messages / see above for error details.
[deoplete] Traceback (most recent call last):
  File "/home/kf/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results
    result = self._get_result(context, source)
  File "/home/kf/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result
    ctx['candidates'] = source.gather_candidates(ctx)
  File "/home/kf/.config/nvim/plugged/deoplete-khard/rplugin/python3/deoplete/sources/khard_emails.py", line 33, in gather_candidates
    self.__fill_cache()
  File "/home/kf/.config/nvim/plugged/deoplete-khard/rplugin/python3/deoplete/sources/khard_emails.py", line 39, in __fill_cache
    for vcard in khard.get_contacts(
  File "/usr/lib/python3.8/site-packages/khard/khard.py", line 451, in get_contacts
    raise ValueError('sort must be "first_name", "last_name" or '
ValueError: sort must be "first_name", "last_name" or "formatted_name" not False.
Error from khard: sort must be "first_name", "last_name" or "formatted_name" not False..  Use :messages / see above for error details.
[deoplete] Too many errors from "khard". This source is disabled until Neovim is restarted.

I am not much of a Pythonista, so I am not quite sure what this all means. Running khard in the command line works as usual.

System: Arch Linux 5.4.54-rt32-1-rt-lts

neovim --version
---
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Output of :checkhealth

health#LanguageClient#check
========================================================================
  - OK: binary found: /home/kf/.config/nvim/plugged/LanguageClient-neovim/bin/languageclient
  - OK: languageclient 0.1.158 
  - OK: Floating window is supported and will be used for hover

health#scnvim#check
========================================================================
## scnvim
  - OK: SCNvim classes installed: /home/kf/.local/share/SuperCollider/Extensions/scide_scnvim
  - OK: has("timers") - success
  - INFO: sclang executable: /usr/bin/sclang
  - INFO: using g:scnvim_scdoc_render_prg = /usr/bin/pandoc
  - INFO: using g:scnvim_scdoc_render_args = % --from html --to plain -o %

health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - OK: Require Python 3.6.1+ was successful
  - OK: Require msgpack 1.0.0+ was successful
  - INFO: If you're still having problems, try the following commands:
    - $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    - $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    - $ nvim
    - $ cat /tmp/log_{PID}
    - and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='5602'
  - INFO: $COLORTERM='truecolor'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: wl-copy

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /usr/bin/python is Python 3.8 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.8.5
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v14.8.0
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.