-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fixes to column number reporting #7078
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
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c0c90d
Fix column numbers of type annotations
JukkaL 6a75deb
New semantic analyzer: fix column number of cast expressions
JukkaL 3777727
Fix error column when type comment has too few/many arguments
JukkaL 94e7467
WIP
JukkaL 8140449
Fix more columns
JukkaL 36e7402
Fix column number of decorators
JukkaL 1d759fd
Fix column of overloaded function
JukkaL faf4718
Add invalid type test
JukkaL 8cf6943
Fix column number of type applications
JukkaL a878d4c
Turn off column numbers by default
JukkaL 1186b7a
Fix test cases
JukkaL 93e1165
Fix one more test case
JukkaL 1d0b003
Respond to feedback
JukkaL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3309,6 +3309,7 @@ def visit_call_expr(self, expr: CallExpr) -> None: | |
# precedence over the CallExpr semantics. | ||
expr.analyzed = CastExpr(expr.args[1], target) | ||
expr.analyzed.line = expr.line | ||
expr.analyzed.column = expr.column | ||
expr.analyzed.accept(self) | ||
elif refers_to_fullname(expr.callee, 'builtins.reveal_type'): | ||
if not self.check_fixed_args(expr, 1, 'reveal_type'): | ||
|
@@ -3516,6 +3517,7 @@ def analyze_type_application(self, expr: IndexExpr) -> None: | |
base = expr.base | ||
expr.analyzed = TypeApplication(base, types) | ||
expr.analyzed.line = expr.line | ||
expr.analyzed.column = expr.column | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are couple more similar places: |
||
# Types list, dict, set are not subscriptable, prohibit this if | ||
# subscripted either via type alias... | ||
if isinstance(base, RefExpr) and isinstance(base.node, TypeAlias): | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a docstring what is the intended use of this method?