palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 282 forks source link

python-language-server and possibly jedi has trouble with PyGObject's GTK #911

Open xrogaan opened 3 years ago

xrogaan commented 3 years ago

Pinging @mpanarin as requested.

Using emacs to write an application based on GTK, pyls seems to have trouble with some if not most object. The project is managed by poetry. pyls tends to use high cpu cycles before failing, which incur a lag within the editor itself — it becomes unresponsive.

Sample code that seem to generate the problem:

class ButtonExplore(Gtk.Button):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.set_label("Explore")

The type of errors I first noticed, but didn't save, was:

[...]
.venv/lib/python3.9/site-packages/jedi/inference/star_args.py", line 26, in _iter_nodes_for_param
    module_node = function_node.get_root_node()
AttributeError: 'NoneType' object has no attribute 'get_root_node'

I haven't been able to reproduce this specific error, it happened organically and I'm not sure of the specifics for its happenstance. However the snipped posted earlier did trigger another kind of error, linked below.

Attached are