Lines Matching +full:- +full:- +full:user +full:- +full:token

1 //===--- SourceCode.h - Manipulating source code as strings -----*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
48 // If not set, defaults to UTF-16 for backwards-compatibility.
51 // Counts the number of UTF-16 code units needed to represent a string (LSP
52 // specifies string lengths in UTF-16 code units).
53 // Use of UTF-16 may be overridden by kCurrentOffsetEncoding.
58 /// If P.character exceeds the line length, returns the offset at end-of-line.
93 /// Returns true if the token at Loc is spelled in the source code.
97 /// * symbols controlled and defined by a compile command-line option
98 /// `-DName=foo`, the spelling location will be "<command line>".
101 /// Turns a token range into a half-open range and checks its correctness.
107 /// macro expansions into file locations is ambiguous - one can use
111 /// User input (e.g. cursor position) is expressed as a file location, so this
113 /// AST so that they are comparable with ranges coming from the user input.
119 /// - start and end locations are valid,
120 /// - start and end locations are file locations from the same file
122 /// - start offset <= end offset.
130 // Converts a half-open clang source range to an LSP range.
137 // Converts an offset to a clang line/column (1-based, columns are bytes).
158 /// - Absolute path
159 /// - Symlinks resolved
160 /// - No "." or ".." component
161 /// - No duplicate or trailing directory separator
169 /// Choose the clang-format style we should apply to a certain file.
170 /// This will usually use FS to look for .clang-format directories.
171 /// FIXME: should we be caching the .clang-format file search?
175 /// to format the entire main file (or a range selected by the user
230 /// - also finds text in comments:
231 /// - splits text into words
232 /// - drops stopwords like "get" and "for"
236 // Could be a "real" token that's "live" in the AST, a spelled token consumed by
237 // the preprocessor, or part of a spelled token (e.g. word in a comment).
245 // - the word is a spelled identifier token
246 // - Text is identifier-like (e.g. "foo_bar")
247 // - Text is surrounded by backticks (e.g. Foo in "// returns `Foo`")
249 // Set if the word is contained in a token spelled in the file.
251 const syntax::Token *PartOfSpelledToken = nullptr;
252 // Set if the word is exactly a token spelled in the file.
253 const syntax::Token *SpelledToken = nullptr;
254 // Set if the word is a token spelled in the file, and that token survives
255 // preprocessing to emit an expanded token spelled the same way.
256 const syntax::Token *ExpandedToken = nullptr;
269 /// This considers using-directives and enclosing namespace-declarations that
273 /// The returned vector is always non-empty.
274 /// - The first element is the namespace that encloses the point: a declaration
276 /// - The elements are the namespaces in scope at the point: an unqualified
316 /// Unlike Info->Location, this translates preamble-patch locations to
317 /// main-file locations.
320 /// Gets the macro referenced by \p SpelledTok. It must be a spelled token
322 std::optional<DefinedMacro> locateMacroAt(const syntax::Token &SpelledTok,
340 /// Translates locations inside preamble patch to their main-file equivalent