mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-25 07:07:14 +08:00
Stdlib modules should not be included in the get_references search, fixes davidhalter/jedi-vim#792
This commit is contained in:
@@ -202,6 +202,10 @@ from keyword import not_existing1, not_existing2
|
||||
from tokenize import io
|
||||
tokenize.generate_tokens
|
||||
|
||||
import socket
|
||||
#? 14 ['SocketIO']
|
||||
socket.SocketIO
|
||||
|
||||
# -----------------
|
||||
# builtins
|
||||
# -----------------
|
||||
|
||||
@@ -383,3 +383,12 @@ usage_definition = 1
|
||||
if False:
|
||||
#< 8 (-3, 0), (0, 4), ('import_tree.references', 1, 21), ('import_tree.references', 5, 4)
|
||||
usage_definition()
|
||||
|
||||
# -----------------
|
||||
# stdlib stuff
|
||||
# -----------------
|
||||
|
||||
import socket
|
||||
#< (1, 21), (0, 7), ('socket', ..., 6), ('stub:socket', ..., 4), ('imports', ..., 7)
|
||||
socket.SocketIO
|
||||
some_socket = socket.SocketIO()
|
||||
|
||||
@@ -107,6 +107,7 @@ import operator
|
||||
from ast import literal_eval
|
||||
from io import StringIO
|
||||
from functools import reduce
|
||||
from unittest.mock import ANY
|
||||
|
||||
import parso
|
||||
from _pytest.outcomes import Skipped
|
||||
@@ -275,6 +276,8 @@ class IntegrationTestCase(BaseTestCase):
|
||||
for pos_tup in positions:
|
||||
if type(pos_tup[0]) == str:
|
||||
# this means that there is a module specified
|
||||
if pos_tup[1] == ...:
|
||||
pos_tup = pos_tup[0], ANY, pos_tup[2]
|
||||
wanted.append(pos_tup)
|
||||
else:
|
||||
line = pos_tup[0]
|
||||
|
||||
Reference in New Issue
Block a user