nixd
Loading...
Searching...
No Matches
nixd
lib
Controller
CodeActions
InheritToBinding.h
Go to the documentation of this file.
1
/// \file
2
/// \brief Code action for converting inherit to explicit binding.
3
///
4
/// Offers to convert inherit statements to explicit bindings:
5
/// - { inherit x; } -> { x = x; }
6
/// - { inherit (b) a; } -> { a = b.a; }
7
8
#pragma once
9
10
#include <
lspserver/Protocol.h
>
11
12
#include <
nixf/Sema/ParentMap.h
>
13
14
#include <llvm/ADT/StringRef.h>
15
16
#include <string>
17
#include <vector>
18
19
namespace
nixf
{
20
class
Node
;
21
}
// namespace nixf
22
23
namespace
nixd
{
24
25
/// \brief Add code action to convert inherit to explicit binding.
26
///
27
/// This action converts inherit statements to explicit bindings:
28
/// - Simple inherit: { inherit x; } -> { x = x; }
29
/// - Inherit from expression: { inherit (b) a; } -> { a = b.a; }
30
///
31
/// The action is only offered when the inherit has exactly one name.
32
void
addInheritToBindingAction
(
const
nixf::Node &N,
33
const
nixf::ParentMapAnalysis &PM,
34
const
std::string &FileURI, llvm::StringRef Src,
35
std::vector<lspserver::CodeAction> &Actions);
36
37
}
// namespace nixd
ParentMap.h
ParentMap analysis.
nixf::Node
Definition
Basic.h:12
Protocol.h
nixd
Definition
CommandLine/Configuration.h:9
nixd::addInheritToBindingAction
void addInheritToBindingAction(const nixf::Node &N, const nixf::ParentMapAnalysis &PM, const std::string &FileURI, llvm::StringRef Src, std::vector< lspserver::CodeAction > &Actions)
Add code action to convert inherit to explicit binding.
Definition
InheritToBinding.cpp:15
nixf
Definition
Diagnostic.h:19
Generated by
1.15.0