Skip to content

Commit 6c3047b

Browse files
authored
Merge branch 'MaskRay:master' into make-didChangeConfiguration-use-its-parameter
2 parents 9281fb7 + 3640f89 commit 6c3047b

21 files changed

Lines changed: 349 additions & 585 deletions

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ target_sources(ccls PRIVATE
201201
src/filesystem.cc
202202
src/fuzzy_match.cc
203203
src/main.cc
204-
src/include_complete.cc
205204
src/indexer.cc
206205
src/log.cc
207206
src/lsp.cc

src/clang_tu.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,7 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
163163
return nullptr;
164164
const llvm::opt::ArgStringList &cc_args = cmd.getArguments();
165165
auto ci = std::make_unique<CompilerInvocation>();
166-
#if LLVM_VERSION_MAJOR >= 10 // rC370122
167166
if (!CompilerInvocation::CreateFromArgs(*ci, cc_args, *diags))
168-
#else
169-
if (!CompilerInvocation::CreateFromArgs(
170-
*ci, cc_args.data(), cc_args.data() + cc_args.size(), *diags))
171-
#endif
172167
return nullptr;
173168

174169
ci->getDiagnosticOpts().IgnoreWarnings = true;
@@ -189,9 +184,7 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
189184
auto &isec = ci->getFrontendOpts().Inputs;
190185
if (isec.size())
191186
isec[0] = FrontendInputFile(main, isec[0].getKind(), isec[0].isSystem());
192-
#if LLVM_VERSION_MAJOR >= 10 // llvmorg-11-init-2414-g75f09b54429
193187
ci->getPreprocessorOpts().DisablePragmaDebugCrash = true;
194-
#endif
195188
// clangSerialization has an unstable format. Disable PCH reading/writing
196189
// to work around PCH mismatch problems.
197190
ci->getPreprocessorOpts().ImplicitPCHInclude.clear();

src/clang_tu.hh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
#include <clang/Basic/SourceManager.h>
1111
#include <clang/Frontend/CompilerInstance.h>
1212

13-
#if LLVM_VERSION_MAJOR < 8
14-
// D52783 Lift VFS from clang to llvm
15-
namespace llvm {
16-
namespace vfs = clang::vfs;
17-
}
18-
#endif
19-
2013
#if LLVM_VERSION_MAJOR < 14 // llvmorg-14-init-3863-g601102d282d5
2114
#define isAsciiIdentifierContinue isIdentifierBody
2215
#endif

src/config.hh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ struct Config {
117117
bool hierarchicalDocumentSymbolSupport = true;
118118
// TextDocumentClientCapabilities.definition.linkSupport
119119
bool linkSupport = true;
120+
// ClientCapabilities.workspace.semanticTokens.refreshSupport
121+
bool semanticTokensRefresh = true;
120122

121123
// If false, disable snippets and complete just the identifier part.
122124
// TextDocumentClientCapabilities.completion.completionItem.snippetSupport
@@ -226,8 +228,9 @@ struct Config {
226228
// Disable semantic highlighting for files larger than the size.
227229
int64_t largeFileSize = 2 * 1024 * 1024;
228230

229-
// true: LSP line/character; false: position
230-
bool lsRanges = false;
231+
// If non-zero, enable rainbow semantic tokens by assinging an extra modifier
232+
// indicating the rainbow ID to each symbol.
233+
int rainbow = 0;
231234

232235
// Like index.{whitelist,blacklist}, don't publish semantic highlighting to
233236
// blacklisted files.
@@ -342,7 +345,7 @@ REFLECT_STRUCT(Config::Completion, caseSensitivity, detailedLabel,
342345
maxNum, placeholder);
343346
REFLECT_STRUCT(Config::Diagnostics, blacklist, onChange, onOpen, onSave,
344347
spellChecking, whitelist)
345-
REFLECT_STRUCT(Config::Highlight, largeFileSize, lsRanges, blacklist, whitelist)
348+
REFLECT_STRUCT(Config::Highlight, largeFileSize, rainbow, blacklist, whitelist)
346349
REFLECT_STRUCT(Config::Index::Name, suppressUnwrittenScope);
347350
REFLECT_STRUCT(Config::Index, blacklist, comments, initialNoLinkage,
348351
initialBlacklist, initialWhitelist, maxInitializerLines,

src/enum.inc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef TOKEN_MODIFIER
2+
#define TOKEN_MODIFIER(name, str)
3+
#endif
4+
// vscode
5+
TOKEN_MODIFIER(Declaration, "declaration")
6+
TOKEN_MODIFIER(Definition, "definition")
7+
TOKEN_MODIFIER(Static, "static")
8+
9+
// ccls extensions
10+
TOKEN_MODIFIER(Read, "read")
11+
TOKEN_MODIFIER(Write, "write")
12+
TOKEN_MODIFIER(ClassScope, "classScope")
13+
TOKEN_MODIFIER(FunctionScope, "functionScope")
14+
TOKEN_MODIFIER(NamespaceScope, "namespaceScope")
15+
16+
// Rainbow semantic tokens
17+
TOKEN_MODIFIER(Id0, "id0")
18+
TOKEN_MODIFIER(Id1, "id1")
19+
TOKEN_MODIFIER(Id2, "id2")
20+
TOKEN_MODIFIER(Id3, "id3")
21+
TOKEN_MODIFIER(Id4, "id4")
22+
TOKEN_MODIFIER(Id5, "id5")
23+
TOKEN_MODIFIER(Id6, "id6")
24+
TOKEN_MODIFIER(Id7, "id7")
25+
TOKEN_MODIFIER(Id8, "id8")
26+
TOKEN_MODIFIER(Id9, "id9")
27+
TOKEN_MODIFIER(Id10, "id10")
28+
TOKEN_MODIFIER(Id11, "id11")
29+
TOKEN_MODIFIER(Id12, "id12")
30+
TOKEN_MODIFIER(Id13, "id13")
31+
TOKEN_MODIFIER(Id14, "id14")
32+
TOKEN_MODIFIER(Id15, "id15")
33+
TOKEN_MODIFIER(Id16, "id16")
34+
TOKEN_MODIFIER(Id17, "id17")
35+
TOKEN_MODIFIER(Id18, "id18")
36+
TOKEN_MODIFIER(Id19, "id19")

src/include_complete.cc

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/include_complete.hh

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)