atom-community / atom-community/ide-python

Unable to goto definitions in __init__.py

Abierto
#487 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
238
Forks
40
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Here is my reproduction project:

```shell
fjompo@grande repro$ find .
.
./foo
./foo/__init__.py
./foo/bar.py
./foo/baz.py

fjompo@grande repro$ cat foo/__init__.py
test = 5

fjompo@grande repro$ cat foo/bar.py
from . import test
from .baz import test2
print(test)
print(test2)

fjompo@grande repro$ cat foo/baz.py
test2 = 42

fjompo@grande repro$ python -m foo.bar
5
42
```

If i go to `foo/bar.py` and highlight `test2`, then go-to-definition works, but for `test` it does not. It simply yields _"Sorry, no definitions found."_

This is likely not an issue with jedi, as shown here:

```python
>>> import jedi
>>> jedi.Script(None, path="foo/bar.py").goto(line=3, column=7, follow_imports=True)[0].module_path
PosixPath('/home/fjompo/tmp/repro/foo/__init__.py')
>>> jedi.Script(None, path="foo/bar.py").goto(line=4, column=7, follow_imports=True)[0].module_path
PosixPath('/home/fjompo/tmp/repro/foo/baz.py')
```
Here are the project files: [repro.zip](https://github.com/atom-community/ide-python/files/8044900/repro.zip)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el problema con foo/__init__.py, foo/bar.py y foo/baz.py, y luego compara el comportamiento de ir a la definición de Atom con las llamadas mostradas a jedi.Script.goto. Empieza por el punto de entrada de integración que gestiona las definiciones para las importaciones de Python. Se considera terminado cuando seleccionar test en foo/bar.py abre foo/__init__.py, mientras que test2 sigue abriendo foo/baz.py.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, python
Área
developer-experience, tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.