sourcegraph / python-langserver

Language server which talks LSP via JSONRPC for Python.
MIT License
102 stars 12 forks source link

local variable 'location' referenced before assignment #36

Closed attfarhan closed 6 years ago

attfarhan commented 6 years ago

when hovering over ___name___ at https://sourcegraph.com/github.com/nameko/nameko-examples/-/blob/products/products/service.py#L9:28


WARNING:langserver.langserver:handler for {'method': 'textDocument/xdefinition', 'params': {'position': {'character': 27, 'line': 8, 'path': '/products/products/service.py'}, 'textDocument': {'uri': 'file:///products/products/service.py'}}, 'id': '395:1', 'meta': {'ot-tracer-sampled': 'true', 'ot-tracer-spanid': 'ac12b4adbe39fab', 'ot-tracer-traceid': '432b1f221e1d4f77'}, 'jsonrpc': '2.0', 'span': <opentracing.span.Span object at 0x101ca2198>} failed
Traceback (most recent call last):
  File "/Users/ggilmore/dev/python/python-langserver/langserver/langserver.py", line 92, in route_and_respond
    resp = handler(request)
  File "/Users/ggilmore/dev/python/python-langserver/langserver/langserver.py", line 403, in serve_x_definition
    symbol_locator["symbol"]["position"] = location["range"][
UnboundLocalError: local variable 'location' referenced before assignment```