You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would love to be able to use dictionary completion to implement a quick-search style feature. It looks as though currently I can implement the ipython_key_completions method, but it does not receive any information about what has been typed after the opening square braces.
Could we have a way to receive the prefix string in the ipython_key_completions method?
Something like: my_object['str <tab>
causes _ipython_key_completions_(prefix: str) to be triggered, where prefix == 'str'
I looked into implementing a custom completer, but couldn't work out how to associate the line context with MyClass without some AST magic. Is there a simple recipe to implement more general completion for dict keys?
The text was updated successfully, but these errors were encountered:
I have a use case where I would love to be able to do this - a tree-like xarray data structure which can be indexed with file-like paths, e.g. 'path/to/node', or even 'path/to/../to/node'.
For path segments like . and .. to work I would need to be able to dynamically alter the list of possible path completions based on the partial path already typed out. So this suggestion
Something like: my_object['str <tab>
causes _ipython_key_completions_(prefix: str) to be triggered, where prefix == 'str'
This is available internally before _get_keys(obj) is performed, which is where _ipython_key_completions_() is called.
Could we simply pass key_prefix as an optional argument down through _get_keys and into _ipython_key_completions_()? Then if the user's class gets a chance to say what the list of possible keys should be given the currently-typed-out prefix?
I would love to be able to use dictionary completion to implement a quick-search style feature. It looks as though currently I can implement the ipython_key_completions method, but it does not receive any information about what has been typed after the opening square braces.
Could we have a way to receive the prefix string in the ipython_key_completions method?
Something like:
my_object['str <tab>
causes
_ipython_key_completions_(prefix: str)
to be triggered, whereprefix == 'str'
I looked into implementing a custom completer, but couldn't work out how to associate the line context with MyClass without some AST magic. Is there a simple recipe to implement more general completion for dict keys?
The text was updated successfully, but these errors were encountered: