maiself / godot-python-extension

Python language bindings for the Godot game engine
https://godot-python-extension.readthedocs.io
MIT License
24 stars 4 forks source link

Autocomplete is broken (Godot 4.3) #31

Open Ivorforce opened 3 weeks ago

Ivorforce commented 3 weeks ago

In Godot 4.3 (at least), autocomplete fails:

  src/module/class_creation_info.cpp:73 - Traceback (most recent call last):
    File "godot/_python_extension/python_language.py", line 170, in _complete_code
      from .editor.code_completion import complete
    File "godot/_python_extension/editor/code_completion.py", line 222, in <module>
      _completer = _Completer()
                   ^^^^^^^^^^^^
    File "godot/_python_extension/editor/code_completion.py", line 105, in __init__
      fs = godot.EditorInterface.get_resource_filesystem()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  TypeError: EditorInterface.get_resource_filesystem() missing 1 required positional argument: 'self'
    While calling: godot._python_extension.python_language.PythonLanguage._complete_code
  

This is because get_resource_filesystem() is a member function, and expects self.

Commenting out the affected lines in __init__ and __del__ works as a workaround.