-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Improve type alias definitions (#3917)
Fixes #3902 This commit ensures to highlight `type` more context sensitively. It may have the following meanings: 1. built-in `type()` function 2. type alias declaration keyword: `type Alias` 3. ordinary variable used in many data classes The built-in function (1.) most likely appears in r-value expressions, such as `my_type = type(var)` At beginning of statements this commit prefers scoping `type` as keyword (2.) or variable (3.) as this is the most likely use case. The implementation ensures to start `meta` scope of alias declarations at bol as class or function declarations do.
- Loading branch information
Showing
2 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters