Since the introduction of "ColumnLimit: 120" in .clang-format, the
column limit has become 120 characters instead of 80 characters.
This prevents clang-format from generating too much changes even if just
a small portion of a source file or header file is modified.
This patch implements `textDocument/semanticTokens/{full,range}`. If the
client supports semantic tokens, $ccls/publishSemanticHighlight (now
deprecated) is disabled.
These token modifiers are mostly useful to emphasize certain symbols:
`static, classScope, globalScope, namespaceScope`.
To enable a colorful syntax highlighting scheme, set the
highlight.rainbow initialization option to 10.
https://maskray.me/blog/2024-10-20-ccls-and-lsp-semantic-tokens
Note that the older $ccls/publishSemanticHighlight protocol with
highlight.lsRanges==true (used by vscode-ccls) is no longer supported.
By default, the background indexer doesn't handle names of no linkage.
They are indexed when their files are opened. This saves memory and
makes cache files smaller.
If the workspace folder is a symlink and the client doesn't follow it.
Treat /tmp/symlink/ as canonical and convert every /tmp/real/ path to
/tmp/symlink/.
cache.hierarchicalPath: store cache files as $directory/a/b/c.cc.blob to
work around NAME_MAX limitation.
cache.retainInMemory: after this number of loads, keep a copy of file
index in memory. If set to 1, it avoids cache corruption if the index
file is changed after the initial load, which may happen if several
language clients open the same project and share the same cache
directory.
Also rename cacheDirectory cacheFormat to cache.{directory,format}
In clients that support DiagnosticRelatedInformation, display
clang notes as these nested diagnostics rather than appending
them to the parent diagnostic's message. Behaviour for clients
that don't support related information should be unchanged.
indexer.cc: use index.maxInitializerLines instead of kInitializerMaxLines
messages/initialize.cc: some ServerCapabilities are toggable:
documentOnTypeFormattingProvider.firstTriggerCharacter
foldingRangeProvider
workspace.workspaceFolders.supported
This fixes a plethora of "not indexed" errors when the document has not been indexed.
* Message handler throws NotIndexed if not overdue
* The message is put into backlog and tagged with backlog_path
* path2backlog[path] tracks backlog associated with document `path`
* The backlog is cleared when the index is merged
* backlog[0] is forced to run if it becomes overdue
textDocument/{declaration,definition,typeDefinition} return either LocationLink[] or Location[]
Add an initialization option client.linkSupport . When it is false, ccls will return Location[] disregarding client's linkSupport.
`struct LocationLink` does not include originSelectionRange as it is wasteful.
* WorkingFiles::files : vector -> unordered_map
* Add timestamp to WorkingFile
* Rename "comp-preload" thread to "preamble"
* Rename CompletionManager to SemaManager as it is used by "diag" "comp" "preamble"
* Rename clang_complete.* to sema_manager.*
* Merge SemaManager::{preloads,sessions}
* Add initialization option session.maxNum
* In DiagnosticMain, if an included file was modified, cancel the DiagTask and create a PreambleTask instead. The task sets `from_diag` so as to trigger immediate DiagTask after the preamble is built.