Improves detection of whether tab-completion is in a string and suppresses Jedi by ecoon · Pull Request #12128 · ipython/ipython (original) (raw)

That would be nice ! Could it even be something that could be upstreamed in Jedi, so we coudl teach jedi to say "I'm in a string" ? or even complete strings ?

I believe so. The code checking "I'm in a string" is entirely based on jedi's parsing. I'm not sure what is there in jedi to complete strings -- most of the time useful string completions would be either filenames or keys in a container, so I'm not sure what is/could be added to jedi with regard to that.

Also, if I get time, I'll look at the implementation for "keys in a dict." Ideally this would be anything that implements keys(), or maybe even anything that implements contains, not just dict -- I've noticed that other file objects such as hdf5/netcdf4 files, which implement the keys() method and mimic a dictionary to work within their file structure don't work with tab completion.