7#include <llvm/ADT/StringRef.h>
23 assert(
false &&
"Invalid severity");
24 __builtin_unreachable();
46llvm::SmallVector<lspserver::DiagnosticTag, 1>
48 llvm::SmallVector<lspserver::DiagnosticTag, 1> Result;
49 Result.reserve(Tags.size());
53 Result.emplace_back(DiagnosticTag::Unnecessary);
56 Result.emplace_back(DiagnosticTag::Deprecated);
Convert between LSP and nixf types.
@ DS_Fatal
shouldn't eval the code, e.g. parsing error.
@ DS_Error
trigger an error in nix, but we can recover & eval the code.
static Severity severity(DiagnosticKind Kind)
A point in the source file.
std::size_t offset() const
Offset in the source file, starting from 0.
Whether current platform treats paths case insensitively.
Position offsetToPosition(llvm::StringRef Code, size_t Offset)
int getLSPSeverity(nixf::Diagnostic::DiagnosticKind Kind)
nixf::PositionRange toNixfRange(const lspserver::Range &P)
lspserver::Position toLSPPosition(llvm::StringRef Code, const nixf::LexerCursor &P)
nixf::Position toNixfPosition(const lspserver::Position &P)
lspserver::Range toLSPRange(llvm::StringRef Code, const nixf::LexerCursorRange &R)
llvm::SmallVector< lspserver::DiagnosticTag, 1 > toLSPTags(const std::vector< nixf::DiagnosticTag > &Tags)
int64_t line
Line position in a document (zero-based).
Position start
The range's start position.
Position end
The range's end position.