Fangrui Song
689c19a5af
Construct SourceManager with UserFilesAreVolatile
...
Fix #235 . Close #453
In clang, it may be worth generalizing UserFilesAreVolatile (introduced in rC160074) to FilesAreVolatile.
2019-10-24 18:37:55 -07:00
Fangrui Song
b400049ced
project: improve ComputeGuessScore heuristics
2019-10-24 18:37:55 -07:00
Fangrui Song
582d9940f0
Support indexing non-existent files in index.onChange:true mode
2019-10-24 18:37:55 -07:00
Fangrui Song
df17dd0952
$ccls/fileInfo: optionally dump dependencies, includes and skipped_ranges
2019-10-24 18:37:55 -07:00
Riatre Foo
7631a92fcc
Change RequestId::value from int to std::string to allow non-numeric IDs.
2019-10-24 18:37:55 -07:00
Fangrui Song
79d6c27ae1
project: support %cu directive and strip -M* options
2019-10-24 18:37:55 -07:00
Fangrui Song
0b47af2310
pipeline: report changed arg
2019-10-24 18:37:55 -07:00
Fangrui Song
1485c5064f
Adapt rL364464: clang::FrontendAction::Execute returns llvm::Error instead of bool
2019-10-24 18:37:55 -07:00
TÖRÖK Attila
8d9728e847
threaded_queue.hh: fix -Wpessimizing-move ( #409 )
2019-10-24 18:37:55 -07:00
Fangrui Song
1a7ace9ccb
utils.hh: work around MSVC STL bug
2019-10-24 18:37:55 -07:00
Fangrui Song
71c8fb108c
Set Diag::concerned if any of its Notes is concerned
2019-10-24 18:37:55 -07:00
Fangrui Song
09207e605e
Adapt llvm rL360179: Option may have multiple OptionCategory's
2019-10-24 18:37:55 -07:00
Fangrui Song
caf292afb9
Refactor FindEntry and use best-fit .ccls
...
Fixes an issue with hierarchical .ccls found by Riatre in #384
2019-10-24 18:37:55 -07:00
Fangrui Song
85df23729a
JsonWriter: write "null" if VersionedTextDocumentIdentifier.version is null
...
Fix #387
2019-10-24 18:37:55 -07:00
Riatre Foo
2cdd3b9e26
Append '/' before populating folder.dot_ccls
2019-10-24 18:37:55 -07:00
Fangrui Song
9dc5a6f90b
Adapt clang rC358696: removal of OutputIsBinary
2019-10-24 18:37:55 -07:00
Fangrui Song
75bce7f78a
Set RetainCommentsFromSystemHeaders to true
...
Note with -fretain-comments-from-system-headers, the .gch of bits/stdc++.h becomes larger by 1%, but that is fine.
And improve comment handling in textDocument/hover
Fix #373
2019-10-24 18:37:55 -07:00
Fangrui Song
29f3071cf7
Set RetainRemappedFileBuffers to true
...
Reported by David Welch in #350 .
This fixes double-free of llvm::MemoryBuffer when parsing fails.
2019-10-24 18:37:55 -07:00
Fangrui Song
1c99760561
Add error checking of object deserialization; ignore non-object initializationOptions
2019-10-24 18:37:55 -07:00
Fangrui Song
c0541342e9
Adapt clang rC357037: removal of setVirtualFileSystem
2019-10-24 18:37:55 -07:00
Fangrui Song
be8b1043a0
Add initialization option index.initialNoLinkage: false
...
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.
2019-10-24 18:37:55 -07:00
Paul Smith
157551f413
Enhance the output of --version with Git describe results. ( #342 )
2019-10-24 18:37:55 -07:00
Fangrui Song
0272a044dc
Change containers of Query*::Def fields from std::vector to ccls::Vec
...
Query*::Def contain several immutable std::vector fields. Change them to
ccls::Vec to save bytes which were wasted by `capacity`.
2019-10-24 18:37:55 -07:00
Fangrui Song
e8f40da198
Add initialization option index.name.suppressUnwrittenScope (default: false)
2019-10-24 18:37:55 -07:00
Fangrui Song
7fb4b291ae
If the workspace folder is a symlink, convert paths relative to it ( #314 )
...
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/.
2019-10-24 18:37:55 -07:00
Fangrui Song
70142fb0bd
cmake: use {LLVM,Clang}Config.cmake
...
Combined Daan De Meyer's #227 with other simplification
* USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB
* LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake
* Only direct Clang/LLVM dependencies are required in target_link_libraries
* Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
2019-10-24 18:37:55 -07:00
Fangrui Song
58207b0700
Add excludeRole to documentSymbol and override declaration's range/selectionRange with definition's
2019-10-24 18:37:55 -07:00
Fangrui Song
52180f1f1f
Misc
2019-10-24 18:37:55 -07:00
Fangrui Song
b1bb8ffd97
Make clang.excludeArgs accept glob patterns
2019-10-24 18:37:55 -07:00
Fangrui Song
c765d3564f
stdin: synthesize an "exit" NotificationMessage in abnormal termination
2019-10-24 18:37:55 -07:00
Fangrui Song
c4545782da
textDocument/rename: mitigate edits in the same place and edits in macro replacement
...
Mitigate edits in the same place (#294 ) and:
// textDocument/rename on `f`
void f();
void g() { m(); } // incorrectly rewrote m() before
2019-10-24 18:37:55 -07:00
Fangrui Song
ce3769f066
working_files: normalize \r\n and \n to \n
...
Clients may normalize end-of-line sequences, thus cause a mismatch
between index_lines and buffer_lines.
Thanks to CXuesong for reporting this issue!
2019-10-24 18:37:55 -07:00
Fangrui Song
baae464195
Change Pos::line from int16_t to uint16_t
...
This allows representing line 0 ~ 65535.
2019-10-24 18:37:55 -07:00
Fangrui Song
03df4085fb
Make hover more detailed (e.g. include inheritance info)
2019-10-24 18:37:55 -07:00
Fangrui Song
ea852374a2
indexer: index TemplateTypeParmDecl and ParmVarDecl in declarations for clang >= 9
...
Index ParmVarDecl in declarations if index.parametersInDeclarations is true
And support some unhandled Decl::Kind
2019-10-24 18:37:55 -07:00
Fangrui Song
c63121d7c6
Add cache.{hierarchicalPath,retainInMemory}
...
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}
2019-10-24 18:37:55 -07:00
Leszek Swirski
33a1982e85
Use DiagnosticRelatedInformation if client supports publishDiagnostics.relatedInformation ( #276 )
...
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.
2019-10-24 18:37:55 -07:00
Fangrui Song
c00f493fcc
indexer: change Pos computation from byte offset to UTF-8 encoded code point offset
2019-10-24 18:37:55 -07:00
Fangrui Song
a833b0cb22
Add initialization option capabilities.*
and index.maxInitializerLines
...
indexer.cc: use index.maxInitializerLines instead of kInitializerMaxLines
messages/initialize.cc: some ServerCapabilities are toggable:
documentOnTypeFormattingProvider.firstTriggerCharacter
foldingRangeProvider
workspace.workspaceFolders.supported
2019-10-24 18:37:55 -07:00
Fangrui Song
8f9973f03c
GetFallback: append clang.extraArgs
...
When compile_commands.json is absent, GetFallback is called to get
default clang command line when there is no .ccls or .ccls is empty.
2019-10-24 18:37:55 -07:00
Fangrui Song
520991c009
Compute CompletionItemKind from Declaration instead of CursorKind
2019-10-24 18:37:55 -07:00
Riatre Foo
0793510541
Fix is_local for vars with non-auto storage period
2019-10-24 18:37:55 -07:00
Riatre Foo
90357034df
textDocument/signatureHelp: enable documentation
2019-10-24 18:37:55 -07:00
Fangrui Song
823aea0207
Log {Request,Notification}Message, and timestamp change due to dependency
2019-10-24 18:37:55 -07:00
Riatre Foo
b5b7e9b7e2
Fix completion result sorting in VSCode ( #210 )
...
Fix #207
2019-10-24 18:37:55 -07:00
Fangrui Song
b6d7661fc4
Implement initialization option compilationDatabaseCommand on Windows
2019-10-24 18:37:55 -07:00
Fangrui Song
a7b2ce5c1f
Drop support for clang 6
2019-10-24 18:37:55 -07:00
Fangrui Song
b0dab7a6d5
Add -log-file=stderr and make it default
...
Change -log-file-append to a boolean flag
2019-10-24 18:37:55 -07:00
Fangrui Song
118c5cea6a
completion: if preamble size changes, rebuild it
...
Fix #190
If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
2019-10-24 18:37:55 -07:00
Fangrui Song
e1b68383c6
textDocument/didOpen: index related files when a header is opened
...
Fix #180
index.initialBlacklist: ["."] can inhibit initial indexing (useful for larger code bases).
Opened files are still indexed, though.
This heuristic allows related files (a/foo.c a/b/foo.cc) to be indexed when a header (foo.h) is opened.
2019-10-24 18:37:55 -07:00