Skip to content
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

No folding of parenth_form expressions without commas #3085

Closed
tysonclugg opened this issue Jul 22, 2022 · 3 comments
Closed

No folding of parenth_form expressions without commas #3085

tysonclugg opened this issue Jul 22, 2022 · 3 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@tysonclugg
Copy link

Issue Type: Bug

  1. Create a file named example_parenth_forms.py with the following content:
parenth_form_without_comma = (
    "This is an expression list parenth_form without comma "
    "yielding a single expression made up by the expression list "
    "as defined in the Python 3 Documentation "
    "» The Python Language Reference "
    "» 6. Expressions "
    "» 6.2.3. Parenthesized forms "
    "which can be viewed at "
    "https://docs.python.org/3/reference/expressions.html#parenthesized-forms"
)

assert isinstance(parenth_form_without_comma, str), (
    "This is a single expression parenth_form without comma yielding a string"
)

parenth_form_with_comma = (
    "This is a single expression parenth_form with comma yielding a tuple",
)

assert isinstance(parenth_form_with_comma, tuple), (
    "This is a %s %s single expression parenth_form without comma" %
    ("more", "complex")
)
  1. Open the file and observe how only the parenth_form_with_comma expression can be folded, none of the parenth_form expressions without commas can be folded.

Extension version: 2022.7.40
VS Code version: Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a, 2022-07-18T16:14:10.636Z)
OS version: Linux x64 5.15.0-41-generic
Restricted Mode: Yes

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 1700)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 15.32GB (0.65GB free)
Process Argv --unity-launch --crash-reporter-id fd6635a6-0561-48ee-9a54-e81fa01ab5c4
Screen Reader no
VM 0%
DESKTOP_SESSION gnome-xorg
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome-xorg
XDG_SESSION_TYPE x11
@tysonclugg
Copy link
Author

I've just tried the pre-release Pylance extension version v2022.7.41 and the issue remains. I hope you find the text in my example file useful to help resolve these issues. 🙂

This may also be related to #1768, #2333, #2542, and #2749.

@debonte debonte self-assigned this Jul 22, 2022
@judej judej added the needs investigation Could be an issue - needs investigation label Jul 25, 2022
@debonte debonte added fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed needs investigation Could be an issue - needs investigation labels Aug 23, 2022
@bschnurr
Copy link
Member

This issue has been fixed in version 2022.8.41, which we've just released. You can find the changelog here: CHANGELOG.md

@tysonclugg
Copy link
Author

Tested in 2022.8.41 (24 August 2022) PreRelease and confirmed fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

4 participants