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

Linting issues duplicated in PROBLEMS panel with pre-release version 2024.23.2025012801 of ms-python.python extension #24783

Open
cmelaro opened this issue Feb 5, 2025 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority needs PR Ready to be worked on

Comments

@cmelaro
Copy link

cmelaro commented Feb 5, 2025

Type: Bug

Behaviour

Linting issues duplicated in PROBLEMS panel with pre-relase version 2024.23.2025012801 of ms-python.python extension.

Steps to reproduce:

  1. Install pre-release version 2024.23.2025012801 of ms-python.python extension.
  2. Install version of the ms-python.pylint and/or ms-python.flake8 extenstions. (I've tried both release and pre-release versions and both exhibit problem.)
  3. Enter any code in editor pane that produces linting issues and observe those issue reported multiple times in the PROBLEMS panel.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2025-02-05 07:58:18.620 [info] Telemetry level is off
2025-02-05 07:58:18.620 [info] Experiments are disabled, only manually opted experiments are active.
2025-02-05 07:58:18.620 [info] Native locator: Refresh started
2025-02-05 07:58:18.620 [info] Native locator: Refresh started
2025-02-05 07:58:18.630 [info] > pyenv which python
2025-02-05 07:58:18.630 [info] cwd: .
2025-02-05 07:58:18.651 [info] > conda info --json
2025-02-05 07:58:18.658 [info] > python -c "import sys;print(sys.executable)"
2025-02-05 07:58:18.705 [info] Native locator: Refresh finished in 1271 ms
2025-02-05 07:58:18.706 [info] > pyenv which python
2025-02-05 07:58:18.706 [info] cwd: .
2025-02-05 07:58:19.553 [info] Starting Pylance language server.
2025-02-05 07:59:02.627 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issue/test.py
2025-02-05 07:59:32.739 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issue/test.py
2025-02-05 08:00:04.370 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issue/test.py
2025-02-05 08:00:26.803 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issue/.vscode/settings.json
2025-02-05 08:00:31.684 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issue/.vscode/settings.json
2025-02-05 08:00:40.990 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issue
2025-02-05 08:00:45.999 [info] Discover tests for workspace name: vscode_python_extenstion_issue - uri: /Users/cmelaro/vscode_python_extenstion_issu

Extension version: 2024.23.2025012801
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Darwin arm64 24.3.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.1.final.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Pylance
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autodocstring njp 0.6.1
autopep8 ms- 2024.0.0
black-formatter ms- 2024.4.0
Bookmarks ale 13.5.0
code-runner for 0.12.2
code-spell-checker str 4.0.34
codespaces Git 1.17.3
copilot Git 1.264.0
copilot-chat Git 0.23.2
datawrangler ms- 1.16.0
debugpy ms- 2024.15.2025012801
even-better-toml tam 0.21.2
flake8 ms- 2023.10.0
gc-excelviewer Gra 4.2.62
git-graph mhu 1.30.0
githistory don 0.6.20
gitlens eam 16.2.1
hexeditor ms- 1.11.1
indent-rainbow ode 8.3.1
intellicode-api-usage-examples Vis 0.2.9
isort ms- 2023.10.1
jq-syntax-highlighting jq- 0.0.2
js-debug ms- 1.96.0
js-debug-companion ms- 1.1.3
jsonpath-extract dav 1.2.3
jupyter ms- 2024.11.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
markdown-all-in-one yzh 3.6.2
material-icon-theme PKi 5.19.0
open-in-browser tec 2.0.0
pdf tom 1.2.2
project-manager ale 12.8.0
pylint ms- 2024.0.0
python ms- 2024.23.2025012801
rainbow-csv mec 3.16.0
remote-containers ms- 0.394.0
remote-explorer ms- 0.4.3
remote-repositories ms- 0.42.0
remote-server ms- 1.5.2
remote-ssh ms- 0.116.1
remote-ssh-edit ms- 0.87.0
remotehub Git 0.64.0
ruff cha 2025.4.0
sort-lines Tyr 1.12.0
sqltools mtx 0.28.3
sqltools-driver-pg mtx 0.5.4
sqltools-driver-sqlite mtx 0.5.1
terraform has 2.34.3
todo-tree Gru 0.0.226
vsc-python-indent Kev 1.19.0
vscode-docker ms- 1.29.4
vscode-edit-csv jan 0.11.2
vscode-eslint dba 3.0.10
vscode-github-actions git 0.27.1
vscode-jq dan 1.2.0
vscode-jq-playground dav 4.3.5
vscode-js-profile-table ms- 1.0.10
vscode-json-path wei 2.4.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-kubernetes-tools ms- 1.3.20
vscode-markdownlint Dav 0.58.2
vscode-open-in-github ziy 1.3.6
vscode-opennewinstance chr 0.0.15
vscode-pull-request-github Git 0.102.0
vscode-pylance ms- 2024.12.1
vscode-python-envs ms- 0.1.2025013001
vscode-remote-extensionpack ms- 0.26.0
vscode-xml red 0.27.2
vscode-yaml red 1.15.0
vscodeintellicode Vis 1.3.2
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 5, 2025
@cmelaro
Copy link
Author

cmelaro commented Feb 5, 2025

Screenshot showing issue...

Image

Note that switching back to the release version of the Python extension (2024.22.2) and restarting extensions makes this issue go away and each problem is shown only once.

@cmelaro cmelaro changed the title Linting issues duplicated in PROBLEMS pane with pre-relase version 2024.23.2025012801 of ms-python.python extension Linting issues duplicated in PROBLEMS panel with pre-release version 2024.23.2025012801 of ms-python.python extension Feb 5, 2025
@karthiknadig
Copy link
Member

You can turn on detailed logs by adding this to your user settings, and share the logs from Output> flake8 or Output> pylint

    "flake8.trace.server": "verbose",
    "pylint.trace.server": "verbose",

That should provide the logs that we need to file a report on VS Code.

The extensions themselves haven been changed to cause such duplication.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 5, 2025
@cmelaro
Copy link
Author

cmelaro commented Feb 5, 2025

Here are the verbose logs for both pylint and flake8...

Flake8.log
Pylint.log

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 5, 2025
@karthiknadig
Copy link
Member

karthiknadig commented Feb 5, 2025

From the logs, we report the issues only once, per update. This should be handled in VS Code.


2025-02-05 13:49:19.082 [info] [Trace - 1:49:19 PM] Received notification 'textDocument/publishDiagnostics'.
2025-02-05 13:49:19.082 [info] Params: {
    "uri": "file:///c%3A/GIT/misc/vscode-python-environments/build/update_ext_version.py",
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 17,
                    "character": 0
                },
                "end": {
                    "line": 17,
                    "character": 0
                }
            },
            "message": "Line too long (121/100)",
            "severity": 3,
            "code": "C0301:line-too-long",
            "codeDescription": {
                "href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/line-too-long.html"
            },
            "source": "Pylint"
        },
        {
            "range": {
                "start": {
                    "line": 0,
                    "character": 0
                },
                "end": {
                    "line": 0,
                    "character": 0
                }
            },
            "message": "Missing module docstring",
            "severity": 3,
            "code": "C0114:missing-module-docstring",
            "codeDescription": {
                "href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/missing-module-docstring.html"
            },
            "source": "Pylint"
        },
        {
            "range": {
                "start": {
                    "line": 63,
                    "character": 0
                },
                "end": {
                    "line": 63,
                    "character": 8
                }
            },
            "message": "Missing function or method docstring",
            "severity": 3,
            "code": "C0116:missing-function-docstring",
            "codeDescription": {
                "href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/missing-function-docstring.html"
            },
            "source": "Pylint"
        },
        {
            "range": {
                "start": {
                    "line": 71,
                    "character": 4
                },
                "end": {
                    "line": 78,
                    "character": 9
                }
            },
            "message": "Unnecessary \"elif\" after \"raise\", remove the leading \"el\" from \"elif\"",
            "severity": 4,
            "code": "R1720:no-else-raise",
            "codeDescription": {
                "href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/no-else-raise.html"
            },
            "source": "Pylint"
        }
    ]
}


2025-02-05 13:49:54.987 [info] [Trace - 1:49:54 PM] Sending notification 'textDocument/didClose'.
2025-02-05 13:49:54.987 [info] Params: {
    "textDocument": {
        "uri": "file:///c%3A/GIT/misc/vscode-python-environments/build/update_ext_version.py"
    }
}


2025-02-05 13:49:54.994 [info] [Trace - 1:49:54 PM] Received notification 'textDocument/publishDiagnostics'.
2025-02-05 13:49:54.995 [info] Params: {
    "uri": "file:///c%3A/GIT/misc/vscode-python-environments/build/update_ext_version.py",
    "diagnostics": []
}

Image

@karthiknadig karthiknadig removed their assignment Feb 5, 2025
@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Feb 5, 2025
@karthiknadig
Copy link
Member

@cmelaro Does uninstalling the ms-python.vscode-python-envs extension fix the problem for you? It seems like that extension is somehow causing this, in my case.

@karthiknadig
Copy link
Member

Thanks for reporting this, it looks like there was a bug in two different places that caused this. Part of the issue was that we generated more than one event for interpreter change. Normally, that would be fine, but in this case it caused the pylint/flake8 extensions to start two separate servers.

I will provide a fix for those as well.

@cmelaro
Copy link
Author

cmelaro commented Feb 6, 2025

@cmelaro Does uninstalling the ms-python.vscode-python-envs extension fix the problem for you? It seems like that extension is somehow causing this, in my case.

@karthiknadig Yes I was able to confirm that removing the ms-python.vscode-python-envs extension does make the problem go away.

@karthiknadig karthiknadig self-assigned this Feb 6, 2025
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on important Issue identified as high-priority labels Feb 6, 2025
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 important Issue identified as high-priority needs PR Ready to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants