Skip to content

diagnostics don't update until the language server is restarted on windows #601

@DetachHead

Description

@DetachHead

Summary

when the language server initially starts, the correct diagnostics are returned, however when subsequent changes are made to the document that would change the diagnostics, the language server still returns the outdated diagnostics.

to reproduce

  1. create a python file with a type error in it:
    asdf 
  2. (re)start the ty language server
  3. see the textDocument/diagnostic result:
    [Trace - 6:14:49 PM] Sending request 'textDocument/diagnostic - (18)'.
    Params: {
        "identifier": "ty",
        "textDocument": {
            "uri": "file:///c%3A/Users/user/Documents/asdfads/test.py"
        }
    }
    
    
    [Trace - 6:14:49 PM] Received response 'textDocument/diagnostic - (18)' in 1ms.
    Result: {
        "items": [
            {
                "code": "unresolved-reference",
                "codeDescription": {
                    "href": "https://ty.dev/rules#unresolved-reference"
                },
                "message": "Name `asdf` used when not defined",
                "range": {
                    "end": {
                        "character": 4,
                        "line": 0
                    },
                    "start": {
                        "character": 0,
                        "line": 0
                    }
                },
                "relatedInformation": [],
                "severity": 1,
                "source": "ty"
            }
        ],
        "kind": "full"
    }
    
  4. delete/comment out the line with the type error:
    # asdf
  5. check the new textDocument/diagnostics response:
    [Trace - 6:15:15 PM] Sending request 'textDocument/diagnostic - (29)'.
    Params: {
        "identifier": "ty",
        "textDocument": {
            "uri": "file:///c%3A/Users/user/Documents/asdfads/test.py"
        }
    }
    
    
    [Trace - 6:15:15 PM] Received response 'textDocument/diagnostic - (29)' in 1ms.
    Result: {
        "items": [
            {
                "code": "unresolved-reference",
                "codeDescription": {
                    "href": "https://ty.dev/rules#unresolved-reference"
                },
                "message": "Name `asdf` used when not defined",
                "range": {
                    "end": {
                        "character": 4,
                        "line": 0
                    },
                    "start": {
                        "character": 0,
                        "line": 0
                    }
                },
                "relatedInformation": [],
                "severity": 1,
                "source": "ty"
            }
        ],
        "kind": "full"
    }
    

Image

environment

ty vscode extension v2025.15.11531247
OS: windows 10

Version

0.0.1-alpha.8 (c1337c9 2025-06-02)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserverRelated to the LSP serverwindowsSpecific to the Windows platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions