clangd broke because it can't look through symlinks. compile_commands manipulation does not fix it, clangd configuration does not fix it, a vfs overlay does not fix it, and while a combination of those can fix it with a bind mount in place that's just too cursed to even consider clangd bug: https://github.com/llvm/llvm-project/issues/116877 Change-Id: I8e3e8489548eb3a7aa65ac9d12a5ec8abf814aec
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#pragma once
|
||
///@file
|
||
|
||
#include "lix/libutil/error.hh"
|
||
#include <map>
|
||
|
||
namespace nix {
|
||
|
||
struct ParsedURL
|
||
{
|
||
std::string url;
|
||
/// URL without query/fragment
|
||
std::string base;
|
||
std::string scheme;
|
||
std::optional<std::string> authority;
|
||
std::string path;
|
||
std::map<std::string, std::string> query;
|
||
std::string fragment;
|
||
|
||
std::string to_string() const;
|
||
|
||
bool operator ==(const ParsedURL & other) const;
|
||
};
|
||
|
||
MakeError(BadURL, Error);
|
||
|
||
std::string percentDecode(std::string_view in);
|
||
std::string percentEncode(std::string_view s, std::string_view keep="");
|
||
|
||
std::map<std::string, std::string> decodeQuery(const std::string & query);
|
||
|
||
ParsedURL parseURL(const std::string & url);
|
||
|
||
/**
|
||
* Although that’s not really standardized anywhere, an number of tools
|
||
* use a scheme of the form 'x+y' in urls, where y is the “transport layer”
|
||
* scheme, and x is the “application layer” scheme.
|
||
*
|
||
* For example git uses `git+https` to designate remotes using a Git
|
||
* protocol over http.
|
||
*/
|
||
struct ParsedUrlScheme {
|
||
std::optional<std::string_view> application;
|
||
std::string_view transport;
|
||
};
|
||
|
||
ParsedUrlScheme parseUrlScheme(std::string_view scheme);
|
||
|
||
}
|