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

The problem found by mypy do not shown in PROBLEMS #206

Open
astro-jingtao opened this issue Nov 2, 2023 · 4 comments
Open

The problem found by mypy do not shown in PROBLEMS #206

astro-jingtao opened this issue Nov 2, 2023 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed

Comments

@astro-jingtao
Copy link

In OUTPUT-Mypy Type Checker I can see mypy really runs and finds some problem in my file, but there are not shown in PROBLEMS

The OUTPUT-Mypy Type Checker ouput:

2023-11-02 13:15:50.666 [info] file://path/to/file//ks.py :
path/to/file//x_xerr.py:5:1:5:1: error: Library stubs not installed for "pandas"  [import-untyped]
path/to/file//x_xerr.py:5:1:5:1: note: Hint: "python3 -m pip install pandas-stubs"
path/to/file//x_xerr.py:5:1:5:1: note: (or run "mypy --install-types" to install all missing stub packages)
path/to/file//x_xerr.py:6:1:6:1: error: Skipping analyzing "optax": module is installed, but missing library stubs or py.typed marker  [import-untyped]
path/to/file//x_xerr.py:7:1:7:1: error: Skipping analyzing "pzflow": module is installed, but missing library stubs or py.typed marker  [import-untyped]
path/to/file//reg.py:2:1:2:1: error: Skipping analyzing "scipy.spatial": module is installed, but missing library stubs or py.typed marker  [import-untyped]
path/to/file//ks.py:2:1:2:1: error: Skipping analyzing "utilize.ndtest": module is installed, but missing library stubs or py.typed marker  [import-untyped]
path/to/file//ks.py:2:1:2:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
path/to/file//ks.py:3:1:3:1: error: Skipping analyzing "utilize.Bcorner": module is installed, but missing library stubs or py.typed marker  [import-untyped]
path/to/file//ks.py:5:1:5:1: error: Skipping analyzing ".grid_search": module is installed, but missing library stubs or py.typed marker  [import-untyped]
path/to/file//ks.py:94:1:94:16: error: Missing positional arguments "arg0", "arg1" in call to "print_mean_std"  [call-arg]

When I set Reporting Scope as workspace, it actually show all problems in PROBLEMS, but when I click the problem, it open a new file named path/to/file/ks.py but not jump to the corresponding line in current opened file (ks.py). Actually, path/to/file/ks.py and ks.py are same file.
image

If this behavior is by design, how could I set the extention to make it as previous. By "previous", I mean when we use

{
    "python.linting.mypyEnabled": true,
    "python.linting.enabled": true
}

to use mypy. In that time, all found problems will be shown in PROBLEMS, when I click the reported preblems, it just jump to the corresponding line in current file.

@karthiknadig
Copy link
Member

This looks like a bug. I will need to look into this.

The following settings are deprecated:

{
    "python.linting.mypyEnabled": true,
    "python.linting.enabled": true
}

@karthiknadig karthiknadig self-assigned this Nov 2, 2023
@karthiknadig
Copy link
Member

Can some one running into this issue provide logs with actual file names? it seems like the file name computation is going wrong somehow.

@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster labels Dec 13, 2023
@tlc
Copy link

tlc commented Dec 19, 2023

  1. Thank you OP for pointing out "Reporting Scope". It was very frustrating getting nothing in my "Problems" list.
  2. I confirm the "Opens new copy of file" behavior.

These are the mypy logs from clicking on the problem

2023-12-19 14:42:31.346 [info] [Trace - 2:42:31 PM] Sending notification 'textDocument/didOpen'.
2023-12-19 14:42:31.357 [info] [Trace - 2:42:31 PM] Received notification 'window/logMessage'.
2023-12-19 14:42:31.357 [info] /home/tlc/miniconda3/envs/PROJ/bin/python -m mypy --no-color-output --no-error-summary --show-absolute-path --show-column-numbers --show-error-codes --no-pretty --show-error-end /home/tlc/my/workplace
2023-12-19 14:42:31.359 [info] [Trace - 2:42:31 PM] Received notification 'window/logMessage'.
2023-12-19 14:42:31.359 [info] CWD Server: /home/tlc/my/workplace

Other clues:

  1. In the opened files tab, it shows "name.py ~/.../abbrev/path..." This is probably automatic differentiation by VSCode.
  2. Subsequent clicks on problems in that file go to the same wrongly opened copy. They don't open another.

@tlc
Copy link

tlc commented Dec 19, 2023

Please note that this is two bugs. "extra files opened when in Reporting Scope is 'workplace'" and "no problems shown when Reporting Scope is 'file'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed
Projects
None yet
Development

No branches or pull requests

3 participants