atom-community / atom-community/ide-python

Unable to goto definitions in __init__.py

オープン
#487 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
238
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

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)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

foo/__init__.py、foo/bar.py、foo/baz.pyで問題を再現し、Atomの定義へ移動する動作と、示されているjedi.Script.gotoの呼び出しを比較します。Pythonのimportに対する定義を処理する統合エントリポイントから始めます。foo/bar.pyでtestを選択するとfoo/__init__.pyが開き、test2は引き続きfoo/baz.pyを開く状態になれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, python
領域
developer-experience, tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。