nixd
Loading...
Searching...
No Matches
NoogleDoc.h
Go to the documentation of this file.
1/// \file
2/// \brief Code action for opening noogle.dev documentation.
3///
4/// Provides a code action to open noogle.dev documentation for lib.* functions.
5
6#pragma once
7
9
10#include <nixf/Sema/ParentMap.h>
11
12#include <string>
13#include <vector>
14
15namespace nixf {
16class Node;
17} // namespace nixf
18
19namespace nixd {
20
21/// \brief Add a code action to open noogle.dev documentation for lib.*
22/// functions.
23///
24/// This action is offered when the cursor is on an ExprSelect with:
25/// - Base expression is ExprVar with name "lib"
26/// - Path contains at least one static attribute name
27///
28/// Examples that trigger:
29/// - lib.optionalString
30/// - lib.strings.optionalString
31/// - lib.attrsets.mapAttrs
32///
33/// Examples that do NOT trigger:
34/// - lib (just the variable, no selection)
35/// - lib.${x} (dynamic attribute)
36/// - pkgs.hello (not lib.*)
37void addNoogleDocAction(const nixf::Node &N, const nixf::ParentMapAnalysis &PM,
38 std::vector<lspserver::CodeAction> &Actions);
39
40} // namespace nixd
ParentMap analysis.
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.
Definition NoogleDoc.cpp:30