Utkarsh Saxena | 73c09eb | 2019-09-16 11:29:35 +0000 | [diff] [blame] | 1 | //===--- 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> |
| 19 | namespace clang { |
| 20 | namespace 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. |
Sam McCall | 8f237f9 | 2020-03-25 00:51:50 +0100 | [diff] [blame] | 25 | /// If pos is not in any interesting range, return [Pos, Pos). |
| 26 | llvm::Expected<SelectionRange> getSemanticRanges(ParsedAST &AST, Position Pos); |
| 27 | |
Kirill Bobyrev | 7a514c9 | 2020-07-14 09:28:38 +0200 | [diff] [blame] | 28 | /// Returns a list of ranges whose contents might be collapsible in an editor. |
| 29 | /// This should include large scopes, preprocessor blocks etc. |
| 30 | llvm::Expected<std::vector<FoldingRange>> getFoldingRanges(ParsedAST &AST); |
| 31 | |
Utkarsh Saxena | 73c09eb | 2019-09-16 11:29:35 +0000 | [diff] [blame] | 32 | } // namespace clangd |
| 33 | } // namespace clang |
| 34 | |
| 35 | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICSELECTION_H |