Skip to content

'in' in the control flow 'for ... in ...' syntax is sometimes recognized as a logical operator #193

@alexr00

Description

@alexr00

From @tweakimp in microsoft/vscode#85271

  • VSCode Version: 1.40.1 and 1.41.0-insider
  • OS Version: Win 10 64bit

Steps to Reproduce:
Type in this python code and use Developer: Inspect TM Scopes to look at the in keyword in each line.

x = [y + 3 for y in range(3)]  # 'in' is recognized as logical operator, but is part of the control flow
z = any(y == 3 for y in range(7))  # 'in' is rightfully recognized as control flow operator

for a in x:  # 'in' is recognized as logical operator, but is part of the control flow
    if a in x:  # 'in' is rightfully recognized as logical operator
        pass

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions