Skip to content
  • Francis Herne's avatar
    Shorten class context range by one line. · d324e78c
    Francis Herne authored
    Class contexts behave in some ways (tooltips, completion) as if they're
     one line longer than they ought to be:
    ```
    a = 2
    class M:
      a = "text"
    b = a # tooltip of `a` says 'str', should be 'int'
    a # 'int'
    ```
    Expression-visitor doesn't have that problem, i.e. `b` is 'int' in the
     example above.
    
    Shortening the class context range by one line fixes tooltips, uses and
     completions, and doesn't seem to break the expression visitor.
    
    Test case "class_scope_end_outside" is fixed by this patch, the others
     are unchanged.
    
    BUG: 309817
    d324e78c