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

BSP: Invalid textDocument field in build/publishDiagnostics notification #2926

Closed
kasiaMarek opened this issue Dec 15, 2023 · 1 comment · Fixed by #2979
Closed

BSP: Invalid textDocument field in build/publishDiagnostics notification #2926

kasiaMarek opened this issue Dec 15, 2023 · 1 comment · Fixed by #2979
Milestone

Comments

@kasiaMarek
Copy link

Mill build server sends build/publishDiagnostics notification with invalid textDocument field, when publishing information about deprecation. It should contain an uri of a text document but is the build target uri instead. This message should most probably just be send via build/logMessage.

[Trace - 02:45:10 pm] Received notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:///Users/kmarek/Desktop/Developer/Tests/scala3-mill-example-project/examples"
  },
  "buildTarget": {
    "uri": "file:///Users/kmarek/Desktop/Developer/Tests/scala3-mill-example-project/examples"
  },
  "diagnostics": [
    {
      "range": {
        "start": {
          "line": 0,
          "character": 0
        },
        "end": {
          "line": 0,
          "character": 0
        }
      },
      "severity": 2,
      "code": "-1",
      "source": "mill",
      "message": "there were 3 deprecation warnings; re-run with -deprecation for details"
    }
  ],
  "reset": false
}

mill-version: 0.11.6-24-0770d3

@lefou
Copy link
Member

lefou commented Jan 18, 2024

Thank you @kasiaMarek for opening this issue. I agree with you. Since the compiler message in question does not belong to a single source file, it's not actionable (in the sense of a published diagnostics), hence we should instead just push a logMessage.

I opened PR #2979 to address this.

@lefou lefou changed the title Invalid textDocument field in build/publishDiagnostics notification BSP: Invalid textDocument field in build/publishDiagnostics notification Jan 18, 2024
lefou added a commit that referenced this issue Jan 18, 2024
…unknown (#2979)

Since some compiler messages do not belong to a single source file, they
are not actionable (in the sense of a BSP `build/publishDiagnostics`).
In such situation (no text document), we send `build/logMessage`
instead.

Fix #2926

Pull request: #2979
@lefou lefou added this to the 0.11.7 milestone Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants