tomv564 / pyls-mypy

Mypy plugin for the Python Language Server
MIT License
110 stars 62 forks source link

Appears to be reporting diagnostics for all open files #15

Closed software-opal closed 5 years ago

software-opal commented 5 years ago

I'm running Atom with ide-python and after some fidling managed to get it do debug stuff.

Basically pyls is reporting mypy errors on the cuurent file; even when they are actually on another open tab. Here, my __main__.py's line 18(I'm guessing lines are zero indexed) is @click_log.simple_verbosity_option(logger).

Received notification 'textDocument/publishDiagnostics'. Params: {
    "uri": "file:///home/opal/piwik3/piwik-release-build/matomo_dl/__main__.py",
    "diagnostics": [
        {
            "source": "mypy",
            "range": {
                "start": {
                    "line": 17,
                    "character": 20
                },
                "end": {
                    "line": 17,
                    "character": 21
                }
            },
            "message": "\"Version\" has no attribute \"version\"",
            "severity": 1
        },
... (many more errors)
software-opal commented 5 years ago

I had originally thought that it was the wrong file; but I can't find any file with .version on the 17th or 18th lines.

It appears as though the errors are a ghost of previous files. I closed all open tabs and then opened the __main__.py


Err ... actually ... it might be related to #12, as I have follow_imports=normal in the setup.cfg

tomv564 commented 5 years ago

You reminded me to merge and publish that PR - do you want to update pyls-mypy and see if the diagnostics from other files disappear?

software-opal commented 5 years ago

Woo :sparkles: it works, thank you for fixing that, and all your hard work

tomv564 commented 5 years ago

Great, thanks for confirming!