Skip to content

diagnostic results are cached #54

Open
@dbkegley

Description

@dbkegley

When I start claude code it is able to detect the LSP diagnostics via the mcp server:

Diagnostics in File: 1
     ERROR at L95:C2: undefined: asdfasdf (Source: compiler, Code: UndeclaredName)

But if I fix the error, save the file, and then ask for diagnostic again the previous results appear to be cached somewhere.

Diagnostics in File: 1
     ERROR at L95:C2: undefined: asdfasdf (Source: compiler, Code: UndeclaredName)

Restarting claude code fetches the updated diagnostics:

● go-lsp:diagnostics (MCP)(filePath: "/home/david/code/...")
  ⎿  No diagnostics found for /home/david/code/...

● No issues found in the modified file.

It's been a while since I used this tool but IIRC it used to work in older versions, maybe before the filewatcher changes?

configuration:

"mcpServers": {
        "go-lsp": {
          "type": "stdio",
          "command": "mcp-language-server",
          "args": [
            "--workspace",
            "/home/david/code",
            "--lsp",
            "gopls"
          ],
          "env": {
            "LOG_LEVEL": "INFO",
            "PATH": "/usr/local/go/bin:/home/david/go/bin",
            "GOPATH": "/home/david/go",
            "GOCACHE": "/home/david/.cache/go-build",
            "GOMODCACHE": "/home/david/go/pkg/mod"
          }
        }
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions