-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indent instead of de-indent when soft wrapping long lines in signatures #15561
Comments
This could be addressed with CSS |
Thanks @krassowski, that sounds like a suitable option even if it isn't supported on all browsers yet. In which file should it be added? |
It is not obvious to me. A safe bet would be a rule targeting the rendered code in tooltips, placing the new rule in |
I would personally vote for it being the default as it makes the text easier to read and does not have any immediate downside (I'm assuming that chrome and other incompatible browsers just fall back to the old default behavior). |
Problem
If the function signature contains long lines, the JupyterLab help pop up / inspector will wrap and de-indent the line. It would be easier to read if the wrapped line was indented relative the original line (just as how indentation is used in python code to indicate belonging to the previous lines/indentation level). Here is an example from the altair docs; you can see how the different parameters melt together and it is hard to tell which options belongs to which parameter due to how the indendation is handled:
There are other reasons that docstring is hard to read, which we are working on in vega/altair#3290, but the way lines are wrapped is one of them.
Proposed Solution
Indent the lines that are wrapped one level more than the indentation of the parameter name. I think this would notably improve readability, e.g. this is what the screenshot above would look like:
This is also how wrapping is handled in the docstring, so it would be consistent to handle it this way in the signature as well.
The text was updated successfully, but these errors were encountered: