python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

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

Open xrogaan opened this issue 4 years ago • 0 comments

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

  • second *pyls::stderr* output https://gist.github.com/xrogaan/17d0ebebc3994864efa6f28593c84e7e
  • pyproject.toml: https://gist.github.com/xrogaan/105b9e191c6a1e53f62b0d330e4ac4d3

PS: This issue was submitted empty because my hand got caught up is my headset's cable and hit the enter key while the focus was not in any text input. Somehow github don't see sending empty issues as an problem?

xrogaan avatar Feb 20 '21 02:02 xrogaan