- Use '/' key to quickly access this field.
- Enter a name of repository, or repository group for quick search.
- Prefix query to allow special search:
user:admin, to search for usernames, always global
user_group:devops, to search for user groups, always global
pr:303, to search for pull request number, title, or description, always global
commit:efced4, to search for commits, scoped to repositories or groups
file:models.py, to search for file paths, scoped to repositories or groups
For advanced full text search visit: repository search
Allow to dispatch getting documentation on objects. (#13975)
Base for #13860, so that object can be queried for documentation on
their fields/properties.
Typically this allows the following, to extend the doc documentation
when requesting information on a field.
```python
class DictLike:
def __getitem__(self, k):
if k.startswith('f'):
return "documentation for k"
else:
raise KeyError
class Bar:
__custom_documentations__ = DictLike()
faz = 1
@property
def foo(self):
return 1
b = Bar()
b.faz?
```
Expose `auto_suggest.resume_hinting`, fix resume on backspace (#13994)
This is a pre-requisite of #13992 but the shortcut is disabled by
default by `never` filter. The idea here is that this could be merged
as-is (ideally after rebasing on top of #13991) to allow user testing.
Once this is in, users can emulate part of the behaviour proposed in
#13992 with the following snippet:
```python
custom_shortcuts = [
{
"command": "IPython:auto_suggest.resume_hinting",
"new_keys": ["right"],
"new_filter": "default_buffer_focused & ((vi_insert_mode & ebivim) | emacs_insert_mode)"
}
]
%config TerminalInteractiveShell.shortcuts = custom_shortcuts
```
Improve API documentation around configuration of embedded IPython (#13989)
This PR tries to improve the API documentation of `embed()`,
`embed_kernel()`, `start_ipython()` and `start_kernel()` with respect to
the configuration of IPython by adding links to other sections of the
documentation. It also reorganizes the API docs so that `embed()` is
listed under `IPython`, just as it's presented in the narrative
documentation.
Handle OSError cases where traceback frames occur from built files (#13964)
I've been using the `_render_traceback_` method of the traceback object, provided by the
`IPython.core.interactiveshell.InteractiveShell` object that you
created, in the `showtraceback` method. Thanks to this, I was able to
create better error messages. I appreciate it. The following issue is
related to the use of this method.
```python
try:
# Exception classes can customise their traceback - we
# use this in IPython.parallel for exceptions occurring
# in the engines. This should return a list of strings.
if hasattr(value, "_render_traceback_"):
stb = value._render_traceback_()
else:
stb = self.InteractiveTB.structured_traceback(
etype, value, tb, tb_offset=tb_offset
)
```
I noticed that in the recent `8.11` version, code was added to generate
a traceback when the source code is too long. In this case, if the
`etb.tb_frame` object is a built file or something similar, the
`inspect.getsourcelines(etb.tb_frame)` method may raise an error. So I
implemented a change to set the `max_len` to the minimum value and avoid
the following condition when an `OSError` occurs. I think this approach
can handle cases where errors occur while using the
`inspect.getsourcelines()` method.
If there is anything I have done wrong or any procedures I should
follow, please let me know. I would greatly appreciate it if you could
leave a comment and I will make the necessary changes immediately. Thank
you.
Allow to dispatch getting documentation on objects
Base for #13860, so that object can be queried for documentation on
their fields/properties.
Typically this allows the following, to extend the doc documentation
when requesting information on a field.
In [1]: class DictLike:
...: def __getitem__(self, k):
...: if k.startswith('f'):
...: return "documentation for k"
...: else:
...: raise KeyError
...:
...: class Bar:
...: __custom_documentations__ = DictLike()
...:
...: faz = 1
...:
...:
...: @property
...: def foo(self):
...: return 1
...: b = Bar()
In [2]: b.faz?
docs: document embed() under IPython
The narrative documentation refers to embed() as IPython.embed(), but
this function is not documented under the IPython module in the API
docs, it is under IPython.terminal.embed. This is because IPython is not
listed in the __names_from_all__ list in autogen_api.py, so only
functions defined directly in IPython/__init__.py are listed, and
embed() is _imported_ there from IPython.terminal.embed.
Add the documentation of embed directly under the IPython module by
adding 'IPython' to the __names_from_all__ list. Note that we avoid
excluding IPython.terminal.embed in the lists of patterns to skip since
we still want to document the rest of the names in this module. Note
also that darker insists on reformatting this list.
Add an explicit __all__ list in IPython/__init__.py, listing the
currently documented functions as well as embed().
Finally, tweak the embed() docstring to refer explicitely to
terminal.embed.InteractiveShellEmbed so that these links keep working.
docs: add pointers to IPython and kernel options
The docstrings of embed_kernel, start_ipython, start_kernel and embed
mention that a traitlets Config can be passed as 'config' to configure
the app / kernel, but the available options are not mentioned.
Adjust write_doc in 'autogen_config.py' so that it adds a label before
the title of each documented class, and use that label to link to the
IPython terminal options from the docstrings of start_ipython and embed,
and to the kernel options from the docstrings of start_kernel and
embed_kernel.