-1

I have included three images highlighting the issue I've encountered with code completion in Dataspell. The image below shows how an instance of Jupyter running in a browser deals with code completion.

enter image description here

In the example below, you can see that for an Axes object labelled as "ax1" DataSpell fails to offer options relating to that object in Matplotlib. Some options it offers (axvline, for example) are only included because they have been used elsewhere in the code.

enter image description here

The issue seems to be that DataSpell does not recognise the type of ax1 (as can be seen from the image below). DataSpell seems to think that ax1 is an "Any" object. Jupyter running in the browser does not have this issue.

enter image description here

The code completion seems to suffer from lots of similar failures to identify the type of the object and so only offers limited generic completion suggestions for the "Any" object.

EDIT:

Another user has kindly sent me an answer that suggests a workaround from 7 years ago that cured the problem for Pycharm. My hope is that the requirement for type hinting, in order to get code-completion behaviour available in other IDEs and Jupyter on the browser, has now disappeared.

I like lots of DataSpell's features, but the requirement to add type hints throughout the code, when other IDEs don't require this, would not be ideal. I'm hoping that I've simply missed an option that enables this common behaviour.

Urizen
  • 2,331
  • 6
  • 23
  • 33
  • 1
    Does this answer your question? [PyCharm - Auto Completion for matplotlib (and other imported modules)](https://stackoverflow.com/questions/36936555/pycharm-auto-completion-for-matplotlib-and-other-imported-modules) – possum May 14 '23 at 18:48
  • Hi, @possum Thank you for the suggestion. The type hinting approach feels like a bit of a hack. VSCode and the standard Jupyter Notebook on the browser don't require this. I was hoping that there might be some setting that I was missing. – Urizen May 14 '23 at 19:51
  • I don't understand. It answers your question but it "feels like a hack"? – possum May 14 '23 at 20:32
  • Adding a type hint each time seems like a clumsy workaround, particularly when other IDEs and Jupyter on the browser don't require this. That's all I'm saying. I was hoping to find that DataSpell also offers completion suggestions without having to litter the code with type hints and that the requirement to add hints was a peculiarity of an older version (the question you kindly pointed me to was asked 7 years ago). Thank you again for sending me the link, though. – Urizen May 15 '23 at 07:33

1 Answers1

0

Having written to JetBrains support, it seems like this is a known issue that was reported four years ago:

Tracking of Issue

In the meantime, the workaround suggested by a user in the comments to my question appears to be one of the only ways to get around the problem.

Urizen
  • 2,331
  • 6
  • 23
  • 33