Skip to content
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

Underline error span instead of just caret (if possible) when using --pretty #7454

Closed
ilevkivskyi opened this issue Sep 3, 2019 · 3 comments

Comments

@ilevkivskyi
Copy link
Member

It would be great instead of:

mypy/semanal.py:1052: error: Argument 1 to "analyze_base_classes" of "SemanticAnalyzer"
has incompatible type "List[Node]"; expected "List[Expression]"  [arg-type]
            result = self.analyze_base_classes(bases)
                                               ^

show something like

mypy/semanal.py:1052: error: Argument 1 to "analyze_base_classes" of "SemanticAnalyzer"
has incompatible type "List[Node]"; expected "List[Expression]"  [arg-type]
            result = self.analyze_base_classes(bases)
                                               ^~~~~

We could use some heuristics and/or Python 3.8 support for end_col_offset:

    if isinstance(context, NameExpr):
        end_column = context.column + len(context.name)
    elif options.python_version >= (3, 8):
        end_column = context.end_column
    ...

This is a follow-up for #7440

@gvanrossum
Copy link
Member

I would only do this if we have definitive end-col info (i.e. 3.8+).

@BenC14
Copy link

BenC14 commented Jul 13, 2021

Would also love to see this, so my IDE can actually underline the nodes completely.

@hauntsaninja
Copy link
Collaborator

Fixed by #13148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants