Home
last modified time | relevance | path

Searched refs:OffsetEncoding (Results 1 – 8 of 8) sorted by relevance

/external/llvm-project/clang-tools-extra/clangd/unittests/
DSourceCodeTests.cpp55 WithContextValue UTF8(kCurrentOffsetEncoding, OffsetEncoding::UTF8); in TEST()
64 WithContextValue UTF32(kCurrentOffsetEncoding, OffsetEncoding::UTF32); in TEST()
79 for (OffsetEncoding Encoding : in TEST()
80 {OffsetEncoding::UTF8, OffsetEncoding::UTF16, OffsetEncoding::UTF32}) { in TEST()
161 WithContextValue UTF32(kCurrentOffsetEncoding, OffsetEncoding::UTF32); in TEST()
218 WithContextValue UTF8(kCurrentOffsetEncoding, OffsetEncoding::UTF8); in TEST()
257 WithContextValue UTF32(kCurrentOffsetEncoding, OffsetEncoding::UTF32); in TEST()
277 WithContextValue UTF8(kCurrentOffsetEncoding, OffsetEncoding::UTF8); in TEST()
/external/llvm-project/clang-tools-extra/clangd/
DSourceCode.cpp107 static size_t measureUnits(llvm::StringRef U8, int Units, OffsetEncoding Enc, in measureUnits()
114 case OffsetEncoding::UTF8: in measureUnits()
117 case OffsetEncoding::UTF16: in measureUnits()
126 case OffsetEncoding::UTF32: in measureUnits()
133 case OffsetEncoding::UnsupportedEncoding: in measureUnits()
144 Key<OffsetEncoding> kCurrentOffsetEncoding;
145 static OffsetEncoding lspEncoding() { in lspEncoding()
147 return Enc ? *Enc : OffsetEncoding::UTF16; in lspEncoding()
154 case OffsetEncoding::UTF8: in lspLength()
157 case OffsetEncoding::UTF16: in lspLength()
[all …]
DProtocol.cpp398 if (auto *OffsetEncoding = O->get("offsetEncoding")) { in fromJSON() local
400 if (!fromJSON(*OffsetEncoding, *R.offsetEncoding, in fromJSON()
1264 static const char *toString(OffsetEncoding OE) { in toString()
1266 case OffsetEncoding::UTF8: in toString()
1268 case OffsetEncoding::UTF16: in toString()
1270 case OffsetEncoding::UTF32: in toString()
1272 case OffsetEncoding::UnsupportedEncoding: in toString()
1277 llvm::json::Value toJSON(const OffsetEncoding &OE) { return toString(OE); } in toJSON()
1278 bool fromJSON(const llvm::json::Value &V, OffsetEncoding &OE, in fromJSON()
1283 OE = llvm::StringSwitch<OffsetEncoding>(*Str) in fromJSON()
[all …]
DProtocol.h371 enum class OffsetEncoding { enum
381 llvm::json::Value toJSON(const OffsetEncoding &);
382 bool fromJSON(const llvm::json::Value &, OffsetEncoding &, llvm::json::Path);
383 llvm::raw_ostream &operator<<(llvm::raw_ostream &, OffsetEncoding);
460 llvm::Optional<std::vector<OffsetEncoding>> offsetEncoding;
DSourceCode.h47 extern Key<OffsetEncoding> kCurrentOffsetEncoding;
DClangdLSPServer.h50 llvm::Optional<OffsetEncoding> Encoding;
DClangdLSPServer.cpp401 Server.Opts.Encoding.getValueOr(OffsetEncoding::UTF16)); in handlerContext()
472 Opts.Encoding = OffsetEncoding::UTF16; // fallback in onInitialize()
473 for (OffsetEncoding Supported : *Params.capabilities.offsetEncoding) in onInitialize()
474 if (Supported != OffsetEncoding::UnsupportedEncoding) { in onInitialize()
/external/llvm-project/clang-tools-extra/clangd/tool/
DClangdMain.cpp449 opt<OffsetEncoding> ForceOffsetEncoding{
455 clEnumValN(OffsetEncoding::UTF8, "utf-8", "Offsets are in UTF-8 bytes"),
456 clEnumValN(OffsetEncoding::UTF16, "utf-16",
458 clEnumValN(OffsetEncoding::UTF32, "utf-32",
460 init(OffsetEncoding::UnsupportedEncoding),
867 if (ForceOffsetEncoding != OffsetEncoding::UnsupportedEncoding) in main()