This PR adds server-side support for dedicated 'unsolved goals' and 'goals accomplished' diagnostics that will have special support in the Lean 4 VS Code extension. The special 'unsolved goals' diagnostic is adapted from the 'unsolved goals' error diagnostic, while the 'goals accomplished' diagnostic is issued when a `theorem` or `Prop`-typed `example` has no errors or `sorry`s. The Lean 4 VS Code extension companion PR is at leanprover/vscode-lean4#585. Specifically, this PR extends the diagnostics served by the language server with the following fields: - `leanTags`: Custom tags that denote the kind of diagnostic that is being served. As opposed to the `code`, `leanTags` should never be displayed in the UI. Examples introduced by this PR are a tag to distinguish 'unsolved goals' errors from other diagnostics, as well as a tag to distinguish the new 'goals accomplished' diagnostic from other diagnostics. - `isSilent`: Whether a diagnostic should not be displayed as a regular diagnostic in the editor. In VS Code, this means that the diagnostic is displayed in the InfoView under 'Messages', but that it will not be displayed under 'All Messages' and that it will also not be displayed with a squiggly line. The `isSilent` field is also implemented for `Message` so that silent diagnostics can be logged in the elaborator. All code paths except for the language server that display diagnostics to users are adjusted to filter `Message`s with `isSilent := true`.
53 lines
1.8 KiB
Text
53 lines
1.8 KiB
Text
{"version": 1,
|
|
"uri": "file:///haveInfo.lean",
|
|
"diagnostics":
|
|
[{"source": "Lean 4",
|
|
"severity": 1,
|
|
"range":
|
|
{"start": {"line": 4, "character": 17}, "end": {"line": 5, "character": 0}},
|
|
"message": "unsolved goals\n⊢ True",
|
|
"leanTags": [1],
|
|
"fullRange":
|
|
{"start": {"line": 4, "character": 17}, "end": {"line": 7, "character": 8}}},
|
|
{"source": "Lean 4",
|
|
"severity": 1,
|
|
"range":
|
|
{"start": {"line": 11, "character": 17},
|
|
"end": {"line": 12, "character": 0}},
|
|
"message": "unsolved goals\n⊢ True",
|
|
"leanTags": [1],
|
|
"fullRange":
|
|
{"start": {"line": 11, "character": 17},
|
|
"end": {"line": 14, "character": 8}}},
|
|
{"source": "Lean 4",
|
|
"severity": 1,
|
|
"range":
|
|
{"start": {"line": 18, "character": 17},
|
|
"end": {"line": 19, "character": 0}},
|
|
"message": "unsolved goals\n⊢ True",
|
|
"leanTags": [1],
|
|
"fullRange":
|
|
{"start": {"line": 18, "character": 17},
|
|
"end": {"line": 21, "character": 8}}},
|
|
{"source": "Lean 4",
|
|
"severity": 1,
|
|
"range":
|
|
{"start": {"line": 25, "character": 17},
|
|
"end": {"line": 26, "character": 0}},
|
|
"message": "unsolved goals\n⊢ True",
|
|
"leanTags": [1],
|
|
"fullRange":
|
|
{"start": {"line": 25, "character": 17},
|
|
"end": {"line": 28, "character": 8}}}]}
|
|
{"textDocument": {"uri": "file:///haveInfo.lean"},
|
|
"position": {"line": 5, "character": 4}}
|
|
{"rendered": "```lean\n⊢ True\n```", "goals": ["⊢ True"]}
|
|
{"textDocument": {"uri": "file:///haveInfo.lean"},
|
|
"position": {"line": 11, "character": 17}}
|
|
{"rendered": "```lean\n⊢ True\n```", "goals": ["⊢ True"]}
|
|
{"textDocument": {"uri": "file:///haveInfo.lean"},
|
|
"position": {"line": 18, "character": 17}}
|
|
{"rendered": "```lean\n⊢ True\n```", "goals": ["⊢ True"]}
|
|
{"textDocument": {"uri": "file:///haveInfo.lean"},
|
|
"position": {"line": 26, "character": 2}}
|
|
{"rendered": "```lean\n⊢ True\n```", "goals": ["⊢ True"]}
|