pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

No folding of parenth_form expressions without commas

Open tysonclugg opened this issue 3 years ago • 1 comments
trafficstars

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 avatar Jul 22 '22 00:07 tysonclugg

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. :slightly_smiling_face:

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

tysonclugg avatar Jul 22 '22 00:07 tysonclugg

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

bschnurr avatar Aug 25 '22 16:08 bschnurr

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

tysonclugg avatar Aug 26 '22 04:08 tysonclugg