31 std::vector<lspserver::CodeAction> &Actions) {
33 const nixf::Node *SelectNode = PM.
upTo(N, nixf::Node::NK_ExprSelect);
40 if (Sel.expr().kind() != nixf::Node::NK_ExprVar)
43 const auto &Var =
static_cast<const nixf::ExprVar &
>(Sel.expr());
44 if (Var.id().name() !=
"lib")
52 if (
Path.names().empty())
56 std::vector<std::string> FunctionPath;
57 FunctionPath.reserve(
Path.names().size() + 1);
58 FunctionPath.emplace_back(
"lib");
60 for (
const auto &Name :
Path.names()) {
61 if (!Name->isStatic())
63 FunctionPath.emplace_back(Name->staticName());
67 std::string NoogleUrl = buildNoogleUrl(FunctionPath);
73 .title =
"Open Noogle documentation for " + FunctionPath.back(),
75 .data = llvm::json::Object{{
"noogleUrl", NoogleUrl}},
void addNoogleDocAction(const nixf::Node &N, const nixf::ParentMapAnalysis &PM, std::vector< lspserver::CodeAction > &Actions)
Add a code action to open noogle.dev documentation for lib.* functions.