ibis icon indicating copy to clipboard operation
ibis copied to clipboard

feat: Improve VSCode experience (type hints, docs, etc)

Open memeplex opened this issue 4 months ago • 6 comments

Is your feature request related to a problem?

Other than basic completions, most "intellisense" seems to be lacking in VSCode:

  • No parameter hints with C-S-Space
  • No help popup with C-K C-I

Most of the time I need to run stuff like t.agg? which is not ideal.

What is the motivation behind your request?

No response

Describe the solution you'd like

Improve static hints or whatever it's needed. I assume basic completions are working because I enabled "jupyter.enableKernelCompletions": true but that's as far as it goes.

What version of ibis are you running?

10.8.0

What backend(s) are you using, if any?

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

memeplex avatar Oct 10 '25 16:10 memeplex

Are you familiar at all with what we would need to do for vscode to pick up on this stuff? Like we have docstrings and often have type hints, what else do we need to do? Can you give a screenshot of some other python library that does this well, so I can

  • see what expected behavior is
  • go see how they have implemented this?

NickCrews avatar Oct 13 '25 19:10 NickCrews

AFAIK we are not doing anything special that would prevent these kinds of things from working.

I regularly use the neovim equivalents of these features such as type hints and docs in pop-up menus, for example.

cpcloud avatar Oct 14 '25 12:10 cpcloud

I started tracking some issues we've had a while back, but seems I forgot to follow up 😅

  • https://github.com/narwhals-dev/narwhals/issues/2960

@MarcoGorelli have there been any more recent pain points?

dangotbanned avatar Oct 14 '25 12:10 dangotbanned

to show a few examples (the first just shows Deferred, the second doesn't show anything)

Image Image

for contrast:

Image Image

I think part of the issue is that a lot of Deferred is hidden behind __getattr__, which is fine at runtime but not for static analysis

https://github.com/ibis-project/ibis/blob/0938c478eb5f24ddab9af1a0f1dd17a8cb7086ff/ibis/common/deferred.py#L98-L101

Another is that, although there are some type annotations, they're not checked in CI

MarcoGorelli avatar Oct 14 '25 13:10 MarcoGorelli

Part of the issue here is that the inherited methods are not typed with Self or @overloads.

For example, NumericColumn inherits __add__ from NumericValue, which is typed as def __add__(...) -> NumericValue:. Thus Pylance thinks numeric_col1 + numeric_col2 is just a NumericValue, not a NumericColumn, and complains (and doesn't offer autocomplete, docstrings, etc.) if you try to then do, e.g., .sum().

Image

ajmarks avatar Nov 20 '25 14:11 ajmarks

Thanks @ajmarks, that is the sort of specific improvement we can make. I opened https://github.com/ibis-project/ibis/pull/11771 to fix that.

NickCrews avatar Nov 20 '25 17:11 NickCrews