diff --git a/flake.lock b/flake.lock index c2be67aca..5db4ddd3a 100644 --- a/flake.lock +++ b/flake.lock @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1730831018, - "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=", + "lastModified": 1732617236, + "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26", + "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 719b49369..14fb4363b 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ callPackage stdenv ; - nix = nixVersions.nix_2_24; + nix = nixVersions.nix_2_25; llvmPackages = llvmPackages_16; nixf = callPackage ./libnixf { }; nixt = callPackage ./libnixt { inherit nix; }; diff --git a/libnixt/test/Value.cpp b/libnixt/test/Value.cpp index 30a2b8536..ab95a5a78 100644 --- a/libnixt/test/Value.cpp +++ b/libnixt/test/Value.cpp @@ -58,7 +58,7 @@ TEST_F(ValueTest, selectAttrPath) { nix::Value &Kern = selectStringViews(*State, Nested, {"c", "d"}); ASSERT_EQ(Kern.type(), nix::ValueType::nInt); - ASSERT_EQ(Kern.integer(), 1); + ASSERT_EQ(Kern.integer(), nix::NixInt{1}); } } // namespace diff --git a/nixd/lib/Eval/AttrSetProvider.cpp b/nixd/lib/Eval/AttrSetProvider.cpp index dd01a23f7..40aa14c53 100644 --- a/nixd/lib/Eval/AttrSetProvider.cpp +++ b/nixd/lib/Eval/AttrSetProvider.cpp @@ -54,8 +54,8 @@ std::optional locationOf(nix::PosTable &PTable, nix::Value &V) { return std::nullopt; Position LPos = { - .line = static_cast(NixPos.line - 1), - .character = static_cast(NixPos.column - 1), + .line = static_cast(NixPos.line - 1), + .character = static_cast(NixPos.column - 1), }; return Location{ @@ -86,8 +86,8 @@ void fillUnsafeGetAttrPosLocation(nix::EvalState &State, nix::Value &V, Column.type() == nix::ValueType::nInt) { // Nix position starts from "1" however lsp starts from zero. - lspserver::Position Pos = {static_cast(Line.integer()) - 1, - static_cast(Column.integer()) - 1}; + lspserver::Position Pos = {static_cast(Line.integer()) - 1, + static_cast(Column.integer()) - 1}; Loc.range = {Pos, Pos}; } } diff --git a/nixd/lspserver/include/lspserver/Protocol.h b/nixd/lspserver/include/lspserver/Protocol.h index 05959073c..dffe1fcb7 100644 --- a/nixd/lspserver/include/lspserver/Protocol.h +++ b/nixd/lspserver/include/lspserver/Protocol.h @@ -127,12 +127,12 @@ bool fromJSON(const llvm::json::Value &, VersionedTextDocumentIdentifier &, struct Position { /// Line position in a document (zero-based). - int line = 0; + int64_t line = 0; /// Character offset on a line in a document (zero-based). /// WARNING: this is in UTF-16 codepoints, not bytes or characters! /// Use the functions in SourceCode.h to construct/interpret Positions. - int character = 0; + int64_t character = 0; friend bool operator==(const Position &LHS, const Position &RHS) { return std::tie(LHS.line, LHS.character) ==