Skip to content

Instantly share code, notes, and snippets.

@kashewnuts
Last active October 11, 2018 04:03
Show Gist options
  • Save kashewnuts/55dfb99f90d828549d225f0a51d47961 to your computer and use it in GitHub Desktop.
Save kashewnuts/55dfb99f90d828549d225f0a51d47961 to your computer and use it in GitHub Desktop.
python-language-serverを試したとき補完が効かないモジュールがあるので記録を残す

前提とする環境

  • OS: macOS Sierra, Ubuntu18.04LTS Desktop
  • Python: 3.6.4(macOS 公式インストーラ), 3.6.6(Ubuntuデフォルト)
  • Vim: macvim-kaoirya, apt install vim-gnome して入ったもの
  • 仮想環境: あるなし関係なくモジュールの補完がうまくいかないものがある
    • なし→Python3.6が動く
    • venv
    • pipenv

vimrc

let s:plug_dir = '~/.cache/plugged'
call plug#begin(s:plug_dir)
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
call plug#end()

if executable('pyls')
  " pip install python-language-server
  autocmd User lsp_setup call lsp#register_server({
      \ 'name': 'pyls',
      \ 'cmd': {server_info->['pyls']},
      \ 'whitelist': ['python'],
      \ })
endif
autocmd FileType python setlocal omnifunc=lsp#complete

let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/.cache/tmp/vim-lsp.log')

pip list結果

(注) palantir/python-language-server のtoxが3.5~3.7で動かなかったので、Python 3.4環境にインストールしている。環境を合わせるためにPython3.6にインストールしても同様な現象は発生している。

$ python3.4 -m pip list
Package                Version
---------------------- -------
future                 0.16.0
jedi                   0.13.1
parso                  0.3.1
pip                    18.1
pluggy                 0.7.1
python-jsonrpc-server  0.0.2
python-language-server 0.21.2
setuptools             40.4.3
wheel                  0.32.1

対象モジュール: (現在確認できているもののみ)

  • pathlib:

    以下のようのなサンプルを用意する

    from pathlib import Path
    
    here = Path('test.txt') # ←ここまではオムニ補完が効く
    here.
    • venv: "here."でオムニ補完しようとすると数秒待って"Path"だけ補完候補にでてくる
    • pipenv: "here."でオムニ補完しようとするとすぐに「パターンは見つかりませんでした。」とメッセージがでてくる

補完時ログ(macOSのみ添付)

Python 3.4にpyls系をインストールしたときのログ

木 10/11 02:14:03 2018:[{"response":{"data":{"__data__":"vim-lsp","server_name":"pyls"},"message":"server already started"}}]
木 10/11 02:14:03 2018:[{"response":{"data":{"__data__":"vim-lsp","init_result":{"id":1,"result":{"capabilities":{"executeCommandProvider":{"commands":[]},"documentHighlightProvider":true,"hoverProvider":true,"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"codeActionProvider":true,"textDocumentSync":2,"codeLensProvider":{"resolveProvider":false},"definitionProvider":true,"documentRangeFormattingProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"experimental":{},"renameProvider":true,"completionProvider":{"resolveProvider":false,"triggerCharacters":["."]}}},"jsonrpc":"2.0"},"server_name":"pyls"},"message":"lsp server already initialized"}}]
木 10/11 02:14:03 2018:[{"response":{"data":{"__data__":"vim-lsp","server_name":"pyls"},"message":"configuration sent"}}]
木 10/11 02:14:03 2018:[{"response":{"data":{"path":"file:///Users/kashewnuts/test.py","__data__":"vim-lsp","server_name":"pyls"},"message":"already opened"}}]
木 10/11 02:14:03 2018:[{"response":{"data":{"path":"file:///Users/kashewnuts/test.py","__data__":"vim-lsp","server_name":"pyls"},"message":"not dirty"}}]
木 10/11 02:14:03 2018:["--->",1,"pyls",{"method":"textDocument/completion","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///Users/kashewnuts/test.py"},"position":{"character":5,"line":7}}}]
木 10/11 02:14:03 2018:["<---",1,"pyls",{"response":{"id":5,"jsonrpc":"2.0","error":{"data":{"traceback":["  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jsonrpc/endpoint.py\", line 113, in consume\n    self._handle_request(message['id'], message['method'], message.get('params'))\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jsonrpc/endpoint.py\", line 182, in _handle_request\n    handler_result = handler(params)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jsonrpc/dispatchers.py\", line 23, in handler\n    return method(**(params or {}))\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/python_ls.py\", line 257, in m_text_document__completion\n    return self.completions(textDocument['uri'], position)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/python_ls.py\", line 185, in completions\n    completions = self._hook('pyls_completions', doc_uri, position=position)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/python_ls.py\", line 117, in _hook\n    return hook_handlers(config=self.config, workspace=self.workspace, document=doc, **kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/hooks.py\", line 258, in __call__\n    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/manager.py\", line 67, in _hookexec\n    return self._inner_hookexec(hook, methods, kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/_tracing.py\", line 82, in __call__\n    return outcome.get_result()\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 76, in get_result\n    raise ex[1].with_traceback(ex[2])\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 48, in from_call\n    result = func()\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/_tracing.py\", line 80, in <lambda>\n    outcome = _Result.from_call(lambda: self.oldcall(hook, hook_impls, kwargs))\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/manager.py\", line 61, in <lambda>\n    firstresult=hook.spec_opts.get('firstresult'),\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 201, in _multicall\n    return outcome.get_result()\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 76, in get_result\n    raise ex[1].with_traceback(ex[2])\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 180, in _multicall\n    res = hook_impl.function(*args)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/plugins/jedi_completion.py\", line 18, in pyls_completions\n    } for d in definitions] or None\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/plugins/jedi_completion.py\", line 18, in <listcomp>\n    } for d in definitions] or None\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/plugins/jedi_completion.py\", line 23, in _label\n    params = ', '.join(param.name for param in definition.params)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jedi/cache.py\", line 143, in wrapper\n    result = method(self, *args, **kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jedi/api/classes.py\", line 345, in params\n    raise AttributeError('There are no params defined on this.')\n"]},"code":-32602,"message":"AttributeError: There are no params defined on this."}},"request":{"method":"textDocument/completion","jsonrpc":"2.0","id":5,"params":{"textDocument":{"uri":"file:///Users/kashewnuts/test.py"},"position":{"character":5,"line":7}}}}]
木 10/11 02:14:03 2018:["<---(stderr)",1,"pyls",["2018-10-11 02:14:03,872 UTC - ERROR - jsonrpc.endpoint - Failed to handle request 5","Traceback (most recent call last):","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jedi/cache.py\", line 141, in wrapper","    return dct[key]","KeyError: ((), frozenset())","","During handling of the above exception, another exception occurred:","","Traceback (most recent call last):","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jsonrpc/endpoint.py\", line 113, in consume","    self._handle_request(message['id'], message['method'], message.get('params'))","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jsonrpc/endpoint.py\", line 182, in _handle_request","    handler_result = handler(params)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jsonrpc/dispatchers.py\", line 23, in handler","    return method(**(params or {}))","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/python_ls.py\", line 257, in m_text_document__completion","    return self.completions(textDocument['uri'], position)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/python_ls.py\", line 185, in completions","    completions = self._hook('pyls_completions', doc_uri, position=position)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/python_ls.py\", line 117, in _hook","    return hook_handlers(config=self.config, workspace=self.workspace, document=doc, **kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/hooks.py\", line 258, in __call__","    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/manager.py\", line 67, in _hookexec","    return self._inner_hookexec(hook, methods, kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/_tracing.py\", line 82, in __call__","    return outcome.get_result()","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 76, in get_result","    raise ex[1].with_traceback(ex[2])","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 48, in from_call","    result = func()","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/_tracing.py\", line 80, in <lambda>","    outcome = _Result.from_call(lambda: self.oldcall(hook, hook_impls, kwargs))","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/manager.py\", line 61, in <lambda>","    firstresult=hook.spec_opts.get('firstresult'),","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 201, in _multicall","    return outcome.get_result()","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 76, in get_result","    raise ex[1].with_traceback(ex[2])","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pluggy/callers.py\", line 180, in _multicall","    res = hook_impl.function(*args)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/plugins/jedi_completion.py\", line 18, in pyls_completions","    } for d in definitions] or None","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/plugins/jedi_completion.py\", line 18, in <listcomp>","    } for d in definitions] or None","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyls/plugins/jedi_completion.py\", line 23, in _label","    params = ', '.join(param.name for param in definition.params)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jedi/cache.py\", line 143, in wrapper","    result = method(self, *args, **kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jedi/api/classes.py\", line 345, in params","    raise AttributeError('There are no params defined on this.')","AttributeError: There are no params defined on this.",""]]

Python 3.6にpyls系をインストールしたときのログ

木 10/11 10:09:35 2018:[{"response":{"data":{"__data__":"vim-lsp","server_name":"pyls"},"message":"server already started"}}]
木 10/11 10:09:35 2018:[{"response":{"data":{"__data__":"vim-lsp","init_result":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":[]},"documentHighlightProvider":true,"hoverProvider":true,"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"codeActionProvider":true,"textDocumentSync":2,"codeLensProvider":{"resolveProvider":false},"definitionProvider":true,"documentRangeFormattingProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"experimental":{},"renameProvider":true,"completionProvider":{"resolveProvider":false,"triggerCharacters":["."]}}}},"server_name":"pyls"},"message":"lsp server already initialized"}}]
木 10/11 10:09:35 2018:[{"response":{"data":{"__data__":"vim-lsp","server_name":"pyls"},"message":"configuration sent"}}]
木 10/11 10:09:35 2018:[{"response":{"data":{"path":"file:///Users/kashewnuts/testenv/tests.py","__data__":"vim-lsp","server_name":"pyls"},"message":"already opened"}}]
木 10/11 10:09:35 2018:[{"response":{"data":{"path":"file:///Users/kashewnuts/testenv/tests.py","__data__":"vim-lsp","server_name":"pyls"},"message":"not dirty"}}]
木 10/11 10:09:35 2018:["--->",1,"pyls",{"method":"textDocument/completion","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///Users/kashewnuts/testenv/tests.py"},"position":{"character":5,"line":5}}}]
木 10/11 10:09:36 2018:["<---",1,"pyls",{"response":{"id":2,"jsonrpc":"2.0","error":{"data":{"traceback":["  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonrpc/endpoint.py\", line 113, in consume\n    self._handle_request(message['id'], message['method'], message.get('params'))\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonrpc/endpoint.py\", line 182, in _handle_request\n    handler_result = handler(params)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonrpc/dispatchers.py\", line 23, in handler\n    return method(**(params or {}))\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/python_ls.py\", line 257, in m_text_document__completion\n    return self.completions(textDocument['uri'], position)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/python_ls.py\", line 185, in completions\n    completions = self._hook('pyls_completions', doc_uri, position=position)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/python_ls.py\", line 117, in _hook\n    return hook_handlers(config=self.config, workspace=self.workspace, document=doc, **kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/hooks.py\", line 258, in __call__\n    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py\", line 67, in _hookexec\n    return self._inner_hookexec(hook, methods, kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/_tracing.py\", line 82, in __call__\n    return outcome.get_result()\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 76, in get_result\n    raise ex[1].with_traceback(ex[2])\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 48, in from_call\n    result = func()\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/_tracing.py\", line 80, in <lambda>\n    outcome = _Result.from_call(lambda: self.oldcall(hook, hook_impls, kwargs))\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py\", line 61, in <lambda>\n    firstresult=hook.spec_opts.get('firstresult'),\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 201, in _multicall\n    return outcome.get_result()\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 76, in get_result\n    raise ex[1].with_traceback(ex[2])\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 180, in _multicall\n    res = hook_impl.function(*args)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py\", line 18, in pyls_completions\n    } for d in definitions] or None\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py\", line 18, in <listcomp>\n    } for d in definitions] or None\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py\", line 23, in _label\n    params = ', '.join(param.name for param in definition.params)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jedi/cache.py\", line 143, in wrapper\n    result = method(self, *args, **kwargs)\n","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jedi/api/classes.py\", line 345, in params\n    raise AttributeError('There are no params defined on this.')\n"]},"code":-32602,"message":"AttributeError: There are no params defined on this."}},"request":{"method":"textDocument/completion","jsonrpc":"2.0","id":2,"params":{"textDocument":{"uri":"file:///Users/kashewnuts/testenv/tests.py"},"position":{"character":5,"line":5}}}}]
木 10/11 10:09:36 2018:["<---(stderr)",1,"pyls",["2018-10-11 10:09:36,377 UTC - ERROR - jsonrpc.endpoint - Failed to handle request 2","Traceback (most recent call last):","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jedi/cache.py\", line 141, in wrapper","    return dct[key]","KeyError: ((), frozenset())","","During handling of the above exception, another exception occurred:","","Traceback (most recent call last):","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonrpc/endpoint.py\", line 113, in consume","    self._handle_request(message['id'], message['method'], message.get('params'))","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonrpc/endpoint.py\", line 182, in _handle_request","    handler_result = handler(params)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonrpc/dispatchers.py\", line 23, in handler","    return method(**(params or {}))","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/python_ls.py\", line 257, in m_text_document__completion","    return self.completions(textDocument['uri'], position)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/python_ls.py\", line 185, in completions","    completions = self._hook('pyls_completions', doc_uri, position=position)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/python_ls.py\", line 117, in _hook","    return hook_handlers(config=self.config, workspace=self.workspace, document=doc, **kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/hooks.py\", line 258, in __call__","    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py\", line 67, in _hookexec","    return self._inner_hookexec(hook, methods, kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/_tracing.py\", line 82, in __call__","    return outcome.get_result()","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 76, in get_result","    raise ex[1].with_traceback(ex[2])","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 48, in from_call","    result = func()","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/_tracing.py\", line 80, in <lambda>","    outcome = _Result.from_call(lambda: self.oldcall(hook, hook_impls, kwargs))","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py\", line 61, in <lambda>","    firstresult=hook.spec_opts.get('firstresult'),","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 201, in _multicall","    return outcome.get_result()","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 76, in get_result","    raise ex[1].with_traceback(ex[2])","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py\", line 180, in _multicall","    res = hook_impl.function(*args)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py\", line 18, in pyls_completions","    } for d in definitions] or None","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py\", line 18, in <listcomp>","    } for d in definitions] or None","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py\", line 23, in _label","    params = ', '.join(param.name for param in definition.params)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jedi/cache.py\", line 143, in wrapper","    result = method(self, *args, **kwargs)","  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jedi/api/classes.py\", line 345, in params","    raise AttributeError('There are no params defined on this.')","AttributeError: There are no params defined on this.",""]]
@kashewnuts
Copy link
Author

以下のように asyncomplete(-lsp).vim を導入して <C-x><C-u> で補完しようとしても補完できないことを確認。

let s:plug_dir = '~/.cache/plugged'
call plug#begin(s:plug_dir)
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
call plug#end()

imap <C-x><C-u> <Plug>(asyncomplete_force_refresh)
if executable('pyls')
  " pip install python-language-server
  autocmd User lsp_setup call lsp#register_server({
      \ 'name': 'pyls',
      \ 'cmd': {server_info->['pyls']},
      \ 'whitelist': ['python'],
      \ })
endif
autocmd FileType python setlocal omnifunc=lsp#complete

let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/.cache/tmp/vim-lsp.log')

@kashewnuts
Copy link
Author

Ubuntu18.04LTS DesktopのVim version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
適用済パッチ: 1-1453
Modified by [email protected]
Compiled by [email protected]
Huge 版 with GTK3 GUI.  機能の一覧 有効(+)/無効(-)
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    +tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          +toolbar
+cindent           +insert_expand     +path_extra        +user_commands
+clientserver      +job               +perl              +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           -python            +vreplace
+conceal           +linebreak         +python3           +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       +lua               -ruby              +X11
+dialog_con_gui    +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             +xim
+digraphs          +modify_fname      +smartindent       +xpm
+dnd               +mouse             +startuptime       +xsmp_interact
-ebcdic            +mouseshape        +statusline        +xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              +mouse_gpm         +syntax            
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
      システム vimrc: "$VIM/vimrc"
      ユーザー vimrc: "$HOME/.vimrc"
   第2ユーザー vimrc: "~/.vim/vimrc"
       ユーザー exrc: "$HOME/.exrc"
     システム gvimrc: "$VIM/gvimrc"
     ユーザー gvimrc: "$HOME/.gvimrc"
  第2ユーザー gvimrc: "~/.vim/gvimrc"
  デフォルトファイル: "$VIMRUNTIME/defaults.vim"
    システムメニュー: "$VIMRUNTIME/menu.vim"
       省略時の $VIM: "/usr/share/vim"
コンパイル: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-NQEcoP/vim-8.0.1453=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
リンク: gcc   -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm     

@kashewnuts
Copy link
Author

macvim-kaoriyaの vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 25 2018 03:02:16)
macOS version
適用済パッチ: 1-1633
Compiled by [email protected]
Huge 版 with MacVim GUI.  機能の一覧 有効(+)/無効(-)
+acl               +file_in_path      -mouse_jsbterm     +tag_binary
+arabic            +find_in_path      +mouse_netterm     +tag_old_static
+autocmd           +float             +mouse_sgr         -tag_any_white
-autoservername    +folding           -mouse_sysmouse    -tcl
+balloon_eval      -footer            +mouse_urxvt       +termguicolors
+balloon_eval_term +fork()            +mouse_xterm       +terminal
+browse            +fullscreen        +multi_byte        +terminfo
++builtin_terms    +gettext           +multi_lang        +termresponse
+byte_offset       +guess_encode      -mzscheme          +textobjects
+channel           -hangul_input      +netbeans_intg     +timers
+cindent           +iconv             +num64             +title
+clientserver      +insert_expand     +odbeditor         +toolbar
+clipboard         +job               +packages          +transparency
+cmdline_compl     +jumplist          +path_extra        +user_commands
+cmdline_hist      +kaoriya           +perl/dyn          +vertsplit
+cmdline_info      +keymap            +persistent_undo   +virtualedit
+comments          +lambda            +postscript        +visual
+conceal           +langmap           +printer           +visualextra
+cryptv            +libcall           +profile           +viminfo
+cscope            +linebreak         +python/dyn        +vreplace
+cursorbind        +lispindent        +python3/dyn       +wildignore
+cursorshape       +listcmds          +quickfix          +wildmenu
+dialog_con_gui    +localmap          +reltime           +windows
+diff              +lua/dyn           +rightleft         +writebackup
+digraphs          +menu              +ruby/dyn          -X11
+dnd               +migemo            +scrollbind        -xfontset
-ebcdic            +mksession         +signs             +xim
+emacs_tags        +modify_fname      +smartindent       -xpm
+eval              +mouse             +startuptime       -xsmp
+ex_extra          +mouseshape        +statusline        -xterm_clipboard
+extra_search      +mouse_dec         -sun_workshop      -xterm_save
+farsi             -mouse_gpm         +syntax
      システム vimrc: "$VIM/vimrc"
      ユーザー vimrc: "$HOME/.vimrc"
   第2ユーザー vimrc: "~/.vim/vimrc"
       ユーザー exrc: "$HOME/.exrc"
     システム gvimrc: "$VIM/gvimrc"
     ユーザー gvimrc: "$HOME/.gvimrc"
  第2ユーザー gvimrc: "~/.vim/gvimrc"
  デフォルトファイル: "$VIMRUNTIME/defaults.vim"
    システムメニュー: "$VIMRUNTIME/menu.vim"
       省略時の $VIM: "
/usr/local/Cellar/macvim-kaoriya/HEAD-db0a1ad/MacVim.app/Contents/Resources/vim
"
コンパイル: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -I/usr/local/Cellar/cmigemo-mk/HEAD-5c014a8/include -I/usr/local/Cellar/gettext/0.19.8.1/include -DMACOS_X -DMACOS_X_DARWIN  -mmacosx-version-min=10.9 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
リンク: /usr/bin/clang   -L. -L/usr/local/lib -L. -L/usr/local/lib -mmacosx-version-min=10.9 -headerpad_max_install_names -L/usr/local/Cellar/gettext/0.19.8.1/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -lintl -lmigemo -framework AppKit  -pagezero_size 10000 -image_base 100000000   -fstack-protector  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment