Skip to content

Error with textDocument/hover #136

@mischnic

Description

@mischnic

I am using this with SublimeText (https://github.com/tomv564/LSP), I hope this is the correct place for posting.

The error occurs when hovering over a symbol.

LSP: request 13: textDocument/hover 
LSP: (stderr):  b'2017-09-13 21:44:08,255 UTC - ERROR - pyls.language_server - CAUGHT'
LSP: (stderr):  b'Traceback (most recent call last):'
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/language_server.py", line 66, in wrapped'
LSP: (stderr):  b'return func(*args, **kwargs)'
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/python_ls.py", line 129, in m_text_document__hover'
LSP: (stderr):  b"return self.hover(textDocument['uri'], position)"
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/python_ls.py", line 81, in hover'
LSP: (stderr):  b"return self._hook('pyls_hover', doc_uri, position=position) or {'contents': ''}"
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/python_ls.py", line 18, in _hook'
LSP: (stderr):  b'doc = self.workspace.get_document(doc_uri) if doc_uri else None'
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/workspace.py", line 48, in get_document'
LSP: (stderr):  b'return self._docs[doc_uri]'
LSP: (stderr):  b"KeyError: u'file:///Users/..../file.py'"

LSP: (stderr):  b'2017-09-13 21:44:08,256 UTC - ERROR - jsonrpc.manager - API Exception: {\'message\': "u\'file:///Users/..../file.py\'", \'args\': (u\'file:///Users/..../file.py\',), \'type\': \'KeyError\'}'
LSP: (stderr):  b'Traceback (most recent call last):'
LSP: got json:  LSP: (stderr): {"jsonrpc":"2.0","id":13,"error":{"message":"Server error","code":-32000,"data":{"message":"u'file:///Users/..../file.py'","args":["file:///Users/niklas/Documents/
LSP: got error:  {'data': {'type': 'KeyError', 'args': ['file:///Users/..../file.py'], 'message': "u'file:///Users/..../file.py'"}, 'code': -32000, 'message': 'Server error'}
 b'File "/Library/Python/2.7/site-packages/jsonrpc/manager.py", line 108, in _get_responses'
LSP: (stderr):  b'result = method(*request.args, **request.kwargs)'
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/language_server.py", line 66, in wrapped'
LSP: (stderr):  b'return func(*args, **kwargs)'
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/python_ls.py", line 129, in m_text_document__hover'
LSP: (stderr):  b"return self.hover(textDocument['uri'], position)"
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/python_ls.py", line 81, in hover'
LSP: (stderr):  b"return self._hook('pyls_hover', doc_uri, position=position) or {'contents': ''}"
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/python_ls.py", line 18, in _hook'
LSP: (stderr):  b'doc = self.workspace.get_document(doc_uri) if doc_uri else None'
LSP: (stderr):  b'File "/Library/Python/2.7/site-packages/pyls/workspace.py", line 48, in get_document'
LSP: (stderr):  b'return self._docs[doc_uri]'
LSP: (stderr):  b"KeyError: u'file:///Users/..../file.py'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions