nixd
Loading...
Searching...
No Matches
nixd
lib
Controller
CodeActions
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
8
#include <
lspserver/Protocol.h
>
9
10
#include <
nixf/Sema/ParentMap.h
>
11
12
#include <string>
13
#include <vector>
14
15
namespace
nixf
{
16
class
Node
;
17
}
// namespace nixf
18
19
namespace
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.*)
37
void
addNoogleDocAction
(
const
nixf::Node &N,
const
nixf::ParentMapAnalysis &PM,
38
std::vector<lspserver::CodeAction> &Actions);
39
40
}
// namespace nixd
ParentMap.h
ParentMap analysis.
nixf::Node
Definition
Basic.h:12
Protocol.h
nixd
Definition
CommandLine/Configuration.h:9
nixd::addNoogleDocAction
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
nixf
Definition
Diagnostic.h:19
Generated by
1.15.0