Skip to content

Commit

Permalink
{flake, nixd/lspserver}: bump llvm 16 → 19 (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc authored Jan 1, 2025
1 parent f97db14 commit 17b7dfd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
let
inherit (pkgs)
nixVersions
llvmPackages_16
llvmPackages_19
callPackage
stdenv
;
nix = nixVersions.nix_2_25;
llvmPackages = llvmPackages_16;
llvmPackages = llvmPackages_19;
nixf = callPackage ./libnixf { };
nixt = callPackage ./libnixt { inherit nix; };
nixd = callPackage ./nixd {
Expand Down
6 changes: 3 additions & 3 deletions nixd/lspserver/src/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,18 @@ bool InboundPort::readDelimitedMessage(std::string &JSONString) {
auto LineRef = Line.str().trim();
if (IsInputBlock) {
// We are in input blocks, read lines and append JSONString.
if (LineRef.startswith("#")) // comment
if (LineRef.starts_with("#")) // comment
continue;

// End of the block
if (LineRef.startswith("```")) {
if (LineRef.starts_with("```")) {
IsInputBlock = false;
break;
}

JSONString += Line;
} else {
if (LineRef.startswith("```json"))
if (LineRef.starts_with("```json"))
IsInputBlock = true;
}
}
Expand Down
1 change: 1 addition & 0 deletions nixd/lspserver/src/Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "lspserver/Protocol.h"
#include "lspserver/Logger.h"
#include "lspserver/URI.h"
#include <llvm/ADT/StringExtras.h>
#include <llvm/ADT/StringRef.h>
#include <llvm/ADT/StringSwitch.h>
#include <llvm/Support/ErrorHandling.h>
Expand Down
1 change: 1 addition & 0 deletions nixd/lspserver/src/SourceCode.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "lspserver/SourceCode.h"
#include "lspserver/Logger.h"
#include <llvm/ADT/StringExtras.h>
#include <llvm/Support/Errc.h>

namespace lspserver {
Expand Down
6 changes: 3 additions & 3 deletions nixd/lspserver/src/URI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FileSystemScheme : public URIScheme {
llvm::Expected<std::string>
getAbsolutePath(llvm::StringRef Authority, llvm::StringRef Body,
llvm::StringRef /*HintPath*/) const override {
if (!Body.startswith("/"))
if (!Body.starts_with("/"))
return error("File scheme: expect body to be an absolute path starting "
"with '/': {0}",
Body);
Expand Down Expand Up @@ -151,7 +151,7 @@ URI::URI(llvm::StringRef Scheme, llvm::StringRef Authority,
llvm::StringRef Body)
: Scheme(Scheme), Authority(Authority), Body(Body) {
assert(!Scheme.empty());
assert((Authority.empty() || Body.startswith("/")) &&
assert((Authority.empty() || Body.starts_with("/")) &&
"URI body must start with '/' when authority is present.");
}

Expand All @@ -163,7 +163,7 @@ std::string URI::toString() const {
return Result;
// If authority if empty, we only print body if it starts with "/"; otherwise,
// the URI is invalid.
if (!Authority.empty() || llvm::StringRef(Body).startswith("/")) {
if (!Authority.empty() || llvm::StringRef(Body).starts_with("/")) {
Result.append("//");
percentEncode(Authority, Result);
}
Expand Down

0 comments on commit 17b7dfd

Please sign in to comment.