jupyterlab-lsp
jupyterlab-lsp copied to clipboard
Hide/show dunder methods and attributes during autocompletion
Elevator Pitch
As a remote JupyterLab user, often hindered by bandwith limitations, it would be useful, to be able to hide dunder methods and attributes during autocompletion for clarity and performance.
Motivation
Dunder special methods and attributes are supposed to be called implicitly, and most of the time are not interesting during any library or class usage.
Arguably, it's similar for _
private methods and attributes.
Design Ideas
In my mind's eye, dunders and private attributes/methods should appear if autocomplete starts explicitly with ._
, as in ipywidgets.IntSlider()._
. Otherwise they should be hidden.
I don't have any opinion or suggestion about implementation.
Thanks Gianluca
I saw the pylsp comment, I don't quite agree that it should be implemented by the IDE. It seems pretty language-specific to me.
Also if it's due to bandwidth it has to go into the language server - we can only filter on frontend.
Wow you're fast :) I am in no position to judge where it belongs, really.
If there's any room for a discussion, in either spaces, I would be happy to follow up...
I don't recall... Did we add message transforming? If so, it seems like something one could write with a little python. I've also considered some declarative approaches like json-e.
As mentioned in https://github.com/python-lsp/python-lsp-server/issues/95#issuecomment-991630861 in the ideal scenario, this feature is implemented on both server side (because not sending completion items for dunders will improve performance) and on the client side (because we still need to filter out kernel completions, or at least tell the kernel that we do not want dunders).