clang-tools
22.0.0git
llvm-project
clang-tools-extra
clangd
InlayHints.h
Go to the documentation of this file.
1
//===--- InlayHints.h --------------------------------------------*- C++-*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// Support for the proposed "inlay hints" LSP feature.
10
// The version currently implemented is the one proposed here:
11
// https://github.com/microsoft/vscode-languageserver-node/pull/609/.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INLAYHINTS_H
16
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INLAYHINTS_H
17
18
#include "
Protocol.h
"
19
#include <vector>
20
21
namespace
clang
{
22
namespace
clangd
{
23
class
ParsedAST
;
24
25
struct
InlayHintOptions
{
26
// Minimum height of a code block in lines for a BlockEnd hint to be shown
27
// Includes the lines containing the braces
28
int
HintMinLineLimit
= 10;
29
};
30
31
/// Compute and return inlay hints for a file.
32
/// If RestrictRange is set, return only hints whose location is in that range.
33
std::vector<InlayHint>
inlayHints
(
ParsedAST
&
AST
,
34
std::optional<Range> RestrictRange,
35
InlayHintOptions
HintOptions = {});
36
37
}
// namespace clangd
38
}
// namespace clang
39
40
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANGD_INLAYHINTS_H
Protocol.h
clang::clangd::ParsedAST
Stores and provides access to parsed AST.
Definition
ParsedAST.h:46
clang::clangd
FIXME: Skip testing on windows temporarily due to the different escaping code mode.
Definition
AST.cpp:45
clang::clangd::SymbolOrigin::AST
@ AST
Definition
SymbolOrigin.h:23
clang::clangd::inlayHints
std::vector< InlayHint > inlayHints(ParsedAST &AST, std::optional< Range > RestrictRange, InlayHintOptions HintOptions)
Compute and return inlay hints for a file.
Definition
InlayHints.cpp:1173
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition
ApplyReplacements.h:27
clang::clangd::InlayHintOptions
Definition
InlayHints.h:25
clang::clangd::InlayHintOptions::HintMinLineLimit
int HintMinLineLimit
Definition
InlayHints.h:28
Generated on
for clang-tools by
1.14.0