Skip to content

Go To Definition using Jedi only moves cursor #7280

Description

@OutOfFocus4

Issue Type: Bug

Since the latest update, when I try to use "Go To Definition" to open a file in my project's venv, it only moves the cursor.

Everything works if I switch to the language server.

Steps to reproduce:

Create a Python file with the following contents:

from unittest import TestCase


class MyTestCase(TestCase):
	def test_example(self):
		with self.assertRaises(ZeroDivisionError):
			value = 1 / 0
		self.assertNotEqual(value, 1)

CTRL + click on assertRaises or assertNotEqual. The cursor will move to the last line of the file.

The problem isn't in Jedi, since the following script gives the correct output:

import jedi

with open('tests.py') as file:
	source = file.read()

script = jedi.Script(source=source, line=6, column=24)
definition = script.goto_definitions()[0]
print('Definition Module: ', definition.module_name)  # prints "Definition Module:  case"
print('Definition Module Path: ', definition.module_path)  # prints "Definition Module Path:  /usr/lib/python3.6/unittest/case.py"

Extension version: 2019.9.34911
VS Code version: Code 1.38.0 (3db7e09, 2019-09-03T21:51:09.716Z)
OS version: Linux x64 4.15.0-60-generic snap

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz (4 x 2368)
GPU Status 2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: disabled_software
viz_display_compositor: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 2, 2, 1
Memory (System) 7.68GB (4.51GB free)
Process Argv
Screen Reader no
VM 0%

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugregressionBug didn't exist in a previous releaseverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions