SublimeJEDI 可以自动完成 custom/external class 个实例吗?
Can SublimeJEDI autocomplete custom/external class instances?
例如:
from PIL import Image
if __name__ == "__main__":
im =Image.open("room.tif")
Image.Image.
当我的光标位于 Image.Image.
之后的点并按下 Ctrl+Space 时,它将显示以下内容:
但是,如果我键入 im.
并按 Ctrl+Space,它将不会显示任何内容。为什么 SublimeJEDI 无法识别 im 也是一个 Image.Image
对象实例?我配置错了吗?还有另一个 plugin/IDE 可以做到这一点吗? SublimeCodeIntel 不能,SublimePythonIDE 也不能(以我有限的经验)。
编辑:
似乎 Atom (autocomplete-python-jedi-plus) 和 SublimeText (SublimeJEDI) 都能够使用内置类型执行此操作,但不能使用外部包(例如 Pillow在这个案例中)
我把这个问题寄给了 SublimePythonIDE 开发人员,得到了以下回复:
Hi,
SublimePythonIDE internally uses the Jedi library, so there shouldn’t
be much difference to SublimeJedi or Anaconda in this regard. Remember
that Python is dynamically typed, so completion is really hard to do
in general, and requires some form of type inference. If Jedi can
infer the type of the variable, then yes. Whether Jedi can do it
depends on many factors, and there is no general answer.
So, all in all, the is answer is: sometimes :-)
例如:
from PIL import Image
if __name__ == "__main__":
im =Image.open("room.tif")
Image.Image.
当我的光标位于 Image.Image.
之后的点并按下 Ctrl+Space 时,它将显示以下内容:
但是,如果我键入 im.
并按 Ctrl+Space,它将不会显示任何内容。为什么 SublimeJEDI 无法识别 im 也是一个 Image.Image
对象实例?我配置错了吗?还有另一个 plugin/IDE 可以做到这一点吗? SublimeCodeIntel 不能,SublimePythonIDE 也不能(以我有限的经验)。
编辑:
似乎 Atom (autocomplete-python-jedi-plus) 和 SublimeText (SublimeJEDI) 都能够使用内置类型执行此操作,但不能使用外部包(例如 Pillow在这个案例中)
我把这个问题寄给了 SublimePythonIDE 开发人员,得到了以下回复:
Hi,
SublimePythonIDE internally uses the Jedi library, so there shouldn’t be much difference to SublimeJedi or Anaconda in this regard. Remember that Python is dynamically typed, so completion is really hard to do in general, and requires some form of type inference. If Jedi can infer the type of the variable, then yes. Whether Jedi can do it depends on many factors, and there is no general answer.
So, all in all, the is answer is: sometimes :-)