blob: b0d301e2efb890d45686a9ff79edc025ce5f6947 [file] [log] [blame]
Utkarsh Saxena73c09eb2019-09-16 11:29:35 +00001//===--- SemanticSelection.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// Features for giving interesting semantic ranges around the cursor.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICSELECTION_H
14#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICSELECTION_H
15#include "ParsedAST.h"
16#include "Protocol.h"
17#include "llvm/Support/Error.h"
18#include <vector>
19namespace clang {
20namespace clangd {
21
22/// Returns the list of all interesting ranges around the Position \p Pos.
23/// The interesting ranges corresponds to the AST nodes in the SelectionTree
24/// containing \p Pos.
25/// Any range in the result strictly contains all the previous ranges in the
26/// result. front() is the inner most range. back() is the outermost range.
27llvm::Expected<std::vector<Range>> getSemanticRanges(ParsedAST &AST,
28 Position Pos);
29} // namespace clangd
30} // namespace clang
31
32#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICSELECTION_H