22#include <boost/asio/post.hpp>
36 namespace fs = std::filesystem;
38 fs::path
Path = fs::absolute((BasePath)).remove_filename().append(
ExprPath);
40 if (!fs::exists(
Path))
43 if (fs::is_directory(
Path))
44 return Path.append(
"default.nix");
49void dfs(
const Node *
N,
const std::string &BasePath,
50 std::vector<DocumentLink> &
Links, llvm::StringRef Src) {
55 case Node::NK_ExprPath: {
58 if (
Path.parts().isLiteral()) {
73 for (
const Node *
Ch :
N->children()) {
80void Controller::onDocumentLink(
86 if (std::shared_ptr<nixf::Node> AST = getAST(*
TU,
Reply)) [[
likely]] {
88 std::vector<DocumentLink>
Links;
94 boost::asio::post(Pool, std::move(
Action));
Convert between LSP and nixf types.
Whether current platform treats paths case insensitively.
llvm::unique_function< void(llvm::Expected< T >)> Callback
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
lspserver::Range toLSPRange(llvm::StringRef Code, const nixf::LexerCursorRange &R)
Parameters for the document link request.
Range range
The range this link applies to.
static URIForFile canonicalize(llvm::StringRef AbsPath, llvm::StringRef TUPath)