| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.LSP.Diagnostic
Description
Handling of diagnostics in the language server - things like warnings and errors.
Every compilation produces the diagnostics for the entire program, so publishing them replaces everything previously published. We do not use the incremental diagnostic store of the lsp library, as its notion of replacement depends on document versions recorded at earlier publications.
Synopsis
- type Diagnostics = Map NormalizedUri [Diagnostic]
- warningDiagnostics :: [(Loc, Doc a)] -> Diagnostics
- errorDiagnostics :: NonEmpty ProgError -> Diagnostics
- showUnlocatedErrors :: NonEmpty ProgError -> LspT () IO ()
- publishDiagnostics :: VFS -> Set NormalizedUri -> Diagnostics -> LspT () IO (Set NormalizedUri)
Documentation
type Diagnostics = Map NormalizedUri [Diagnostic] Source #
The diagnostics of every file that has any.
warningDiagnostics :: [(Loc, Doc a)] -> Diagnostics Source #
Diagnostics for the warnings of a successful compilation.
errorDiagnostics :: NonEmpty ProgError -> Diagnostics Source #
Diagnostics for the problems of a failed compilation.
showUnlocatedErrors :: NonEmpty ProgError -> LspT () IO () Source #
Errors without a location cannot be attached to a file, so they are shown as messages.
publishDiagnostics :: VFS -> Set NormalizedUri -> Diagnostics -> LspT () IO (Set NormalizedUri) Source #
Publish the diagnostics of a compilation of the given VFS, for every open file and every file in the given set of files that were previously published for. Returns the files that now have diagnostics. A client may discard a publication for a document it has since changed, so open files are published for even when they have no diagnostics.