Skip to content

KeyError in workspace.py line 110, in get_document #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcepl opened this issue Feb 19, 2018 · 5 comments
Closed

KeyError in workspace.py line 110, in get_document #263

mcepl opened this issue Feb 19, 2018 · 5 comments

Comments

@mcepl
Copy link

mcepl commented Feb 19, 2018

I found this in my log:

2018-02-19 18:36:59,921 UTC - DEBUG - pyls.server - Got message: b'{"jsonrpc":"2.0","method":"textDocument/didClose","params":{"textDocument":{"uri":"file:///home/matej/archiv/knihovna/repos/freeipa/ipaserver/install/bindinstance.py"}}}'
2018-02-19 18:37:51,329 UTC - DEBUG - pyls.server - Got message: b'{"jsonrpc":"2.0","method":"textDocument/definition","params":{"position":{"character":10,"line":358},"textDocument":{"uri":"file:///home/matej/archiv/knihovna/repos/freeipa/ipaserver/install/bindinstance.py"}},"id":19}'
2018-02-19 18:37:51,329 UTC - ERROR - jsonrpc.manager - API Exception: {'type': 'KeyError', 'args': ('file:///home/matej/archiv/knihovna/repos/freeipa/ipaserver/install/bindinstance.py',), 'message': "'file:///home/matej/archiv/knihovna/repos/freeipa/ipaserver/install/bindinstance.py'"}
Traceback (most recent call last):
  File "/home/matej/.local/lib/python3.4/site-packages/jsonrpc/manager.py", line 112, in _get_responses
    result = method(*request.args, **request.kwargs)
  File "/home/matej/.local/lib/python3.4/site-packages/pyls/dispatcher.py", line 19, in wrapped
    return func(*args, **kwargs)
  File "/home/matej/.local/lib/python3.4/site-packages/pyls/python_ls.py", line 157, in m_text_document__definition
    return self.definitions(textDocument['uri'], position)
  File "/home/matej/.local/lib/python3.4/site-packages/pyls/python_ls.py", line 92, in definitions
    return flatten(self._hook('pyls_definitions', doc_uri, position=position))
  File "/home/matej/.local/lib/python3.4/site-packages/pyls/python_ls.py", line 39, in _hook
    doc = self.workspace.get_document(doc_uri) if doc_uri else None
  File "/home/matej/.local/lib/python3.4/site-packages/pyls/workspace.py", line 110, in get_document
    return self._docs[doc_uri]
KeyError: 'file:///home/matej/archiv/knihovna/repos/freeipa/ipaserver/install/bindinstance.py'

bindinstance.py is from FreeIPA and this is the local copy.

@gatesn
Copy link
Contributor

gatesn commented Feb 21, 2018

@mcepl this is a client bug, which language server client are you using?

@mcepl
Copy link
Author

mcepl commented Feb 21, 2018

https://github.com/autozimu/LanguageClient-neovim with vim8 8.0.1520.

@gatesn
Copy link
Contributor

gatesn commented Feb 21, 2018

@autozimu looks like the client sent didClose, and then a definition message afterwards for the same document.

@autozimu
Copy link

@mcepl please file bug in client repo following issue template.

@mcepl
Copy link
Author

mcepl commented Feb 21, 2018

@autozimu Unfortunately, I am not able to reliably reproduce this. Are you still interested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants