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
Docstrings are truncated even when expanding completion pop-up window to maximum size #211737
Comments
one is completion tooltip and the other is hover tooltip. can you resize tooltip window of completion tooltip? unlike hover tooltip, completion tooltip won't show horizontal scrollbar for long text. but FYI, completion tooltip resize allows you to resize up to vscode window size so, if doc string require bigger window than vscode window, then you won't be able to see it. we might need to ask vscode to improve vscode. |
Certainly, I can resize the tooltip window for completion tooltip. However, even if I resize the window to its maximum size, the text may still be truncated. It seems that if completion tooltips could wrap text like hover tooltips, it would greatly improve the usability. |
def paragraph(nb_sentences: int = 3, variable_nb_sentences: bool = True, ext_word_list: list[str] | None = None) -> str:
"""
Generate a paragraph.
The nb_sentences argument controls how many sentences the paragraph
will contain, and setting variable_nb_sentences to False will
generate the exact amount, while setting it to True (default) will
generate a random amount (+/-40%, minimum of 1) using
randomize_nb_elements().
Under the hood, sentences() is used to generate the sentences, so the
argument ext_word_list works in the same way here as it would in
that method.
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
... fake.paragraph(nb_sentences=5)
...
'American whole magazine truth stop whose. On traditional measure example sense peace. Would mouth relate own chair. Role together range line. Government first policy daughter.'
'Kind miss artist truth trouble behavior style. Ability management test during foot that course nothing. Sound central myself before year. Your majority feeling fact by four two. White owner onto knowledge other. First drug contain start almost wonder.'
'Attorney quickly candidate change although bag record. Raise study modern miss dog Democrat quickly. Often late produce you true soldier. Food break onto friend.'
'Administration even relate head color. Staff beyond chair recently and off. Own available buy country store build before. Already against which continue.'
'Decision song view age international big employee. Author feeling job article level. Beyond write current grow rule stuff truth college.'
>>> Faker.seed(0)
>>> for _ in range(5):
... fake.paragraph(nb_sentences=5, variable_nb_sentences=False)
...
'Serious inside else memory if six. Whose group through despite cause. Sense peace economy travel. Total financial role together range line beyond its. Policy daughter need kind miss artist truth trouble.'
'Rest human station property. Partner stock four. Region as true develop sound central. Language ball floor meet usually board necessary. Natural sport music white.'
'Natural explain before something first drug contain start. Party prevent live. Quickly candidate change although. Together type music hospital. Every speech support time operation wear often.'
'Manage political record word group food break. Picture suddenly drug rule bring determine some forward. Beyond chair recently and. Plant view own available buy country store. Hospital have wonder already.'
'Create wife responsibility. Decision song view age international big employee. Author feeling job article level. Beyond write current grow rule stuff truth college. Whom around put suddenly garden.'
>>> Faker.seed(0)
>>> for _ in range(5):
... fake.paragraph(nb_sentences=5, ext_word_list=['abc', 'def', 'ghi', 'jkl'])
...
'Abc jkl def jkl jkl jkl. Ghi jkl ghi def jkl ghi. Jkl ghi ghi ghi abc. Ghi jkl ghi def. Def def ghi abc.'
'Def ghi abc jkl jkl abc jkl. Abc def jkl abc def jkl abc ghi. Jkl abc ghi abc jkl. Jkl def def def abc def jkl. Jkl ghi ghi def ghi. Def abc abc jkl abc jkl.'
'Abc ghi abc abc abc abc ghi. Ghi jkl ghi ghi abc abc ghi. Ghi def ghi jkl jkl jkl. Def abc ghi def.'
'Abc def ghi def abc. Jkl abc abc ghi abc ghi. Ghi abc abc abc jkl abc abc. Abc abc jkl abc.'
'Abc jkl jkl abc def abc def. Abc def def abc def. Abc jkl abc def ghi jkl jkl abc.'
>>> Faker.seed(0)
>>> for _ in range(5):
... fake.paragraph(nb_sentences=5, variable_nb_sentences=False, ext_word_list=['abc', 'def', 'ghi', 'jkl'])
...
'Jkl def def ghi def jkl. Jkl def jkl abc abc. Jkl ghi def jkl. Jkl def ghi jkl ghi def abc def. Ghi abc ghi def ghi abc jkl jkl.'
'Ghi def jkl ghi. Ghi jkl def. Ghi abc jkl abc jkl abc. Def abc def ghi jkl abc ghi. Ghi jkl ghi jkl.'
'Ghi def abc jkl def abc abc jkl. Ghi ghi def. Ghi abc abc abc. Jkl jkl ghi def. Def jkl jkl jkl ghi jkl ghi.'
'Def ghi ghi jkl def def abc. Ghi jkl abc ghi abc abc jkl def. Abc abc ghi abc. Ghi jkl ghi abc abc abc jkl. Def def jkl abc.'
'Abc jkl ghi. Abc jkl jkl abc def abc def. Abc def def abc def. Abc jkl abc def ghi jkl jkl abc. Jkl abc ghi jkl def.'
"""
pass Above is the python function with very long docstring, hope it's helpful. |
@luabud should we transfer this feedback to vscode team? UI (and resize) is owned by the platform (vscode). that said, we might create view only for doc string rather than using tooltip since as V4n1st said python doc string tends to be very large and doesn't fit well with vscode's builtin tooltip? |
@luabud @heejaechang Sorry, but how to I reproduce this? I have python/pylance installed and I am using the file above but I don't get completions |
it shouldn't need auto imports enabled for the example above though, right? I think it's weird that it showed "no suggestions" here. Doing the same thing and hitting @jrieken can you make sure Pylance is enabled? You can check if |
Behaviour
The tooltip for the docstring that pops up when entering a partial function name is truncated, causing long lines to be cut off.
Steps to reproduce:
Entering the function name letter by letter, the docstring tooltip show up
Viewing the tooltip and find the long line truncated.
Hope it'd be fixed.
Best wishes.
The text was updated successfully, but these errors were encountered: