Commit Graph

1904 Commits

Author SHA1 Message Date
Fangrui Song
bc4dc6720b Add pipeline::{Notify,Reply,ReplyError} and simplify message handling
Delete method.{cc,h}
Rename $ccls/setSkippedRanges to $ccls/publishSkippedRanges
Rename $ccls/publishSemanticHighlighting to $ccls/publishSemanticHighlight; stableId -> id
2019-11-09 20:03:28 -08:00
Fangrui Song
4a1eea75db Misc changes to project
* Better LanguageId detection with clangDriver (e.g. .cu -> types::TY_CUDA)
* fallback when there is no .ccls or compile_commands.json

Also Hide clangTooling options from --help
2019-11-09 20:03:28 -08:00
Fangrui Song
40b47f9ca3 Adapt trunk change and write comments to PCH 2019-11-09 20:03:28 -08:00
Fangrui Song
f9cf7854fa -DSYSTEM_CLANG=off: 6.0.1 -> 7.0.0 2019-11-09 20:03:28 -08:00
Riatre Foo
ec71d4c6c0 Fix hierarchical document symbol
1. Fixed a bug on building document symbol tree: As sym2ds was updated in
place, nested funcs/types may be moved into children of another
lsDocumentSymbol before itself got processed.

2. Namespaces only have declarations, in the old implementation it wasn't included in the result, making the result less hierarchical. This
commit fixes this by including the declarations of a symbol if no
definitions found.
2019-11-09 20:03:28 -08:00
Fangrui Song
82deedf8c3 Add namespace alias clang::vfs = llvm::vfs to adapt D52783
vfs::x should be written as llvm::vfs::x to work around a [namepace.udir] bug before GCC 8 when namespace alias is used
2019-11-09 20:03:28 -08:00
Fangrui Song
7b19c87485 Namespace: improve indexer and don't trace bases in $ccls/member 2019-11-09 20:03:28 -08:00
Riatre Foo
3de62168c8 Fix additionalTextEdits -> textEdit hack for VS Code (#89)
* Fix additionalTextEdits -> textEdit hack for VS Code

Visual Studio Code filters the completion result according to
textEdit.range and filterText, if the textEdit.range overlaps with
existing text, we have to include it in filterText, otherwise it would
be filtered out.

* Fix has_open_paren in FilterCandidates
2019-11-09 20:03:28 -08:00
Fangrui Song
49dd0ed558 Support workspace folders 2019-11-09 20:03:28 -08:00
Fangrui Song
e352604ee4 Improve completion
blacklist some undesired candidates
additionalTextEdits if clang>=7
Use CodePatterns for preprocessor directive completion if there is a #
Prefer textEdit over insertText
2019-11-09 20:03:28 -08:00
Fangrui Song
a920e71711 Clean and update tests after Index* refactoring 2019-11-09 20:03:28 -08:00
Fangrui Song
2864f2c647 Use DeclRef spell to represent Use spell + Use extent 2019-11-09 20:03:28 -08:00
Fangrui Song
08b09bc1da Redesign SymbolRef, Ref, Use
Remove lsLocationEx
2019-11-09 20:03:28 -08:00
Fangrui Song
0c5c3a11be Add completion.maxNum: 100 2019-11-09 20:03:28 -08:00
Fangrui Song
8b2565fcd0 For $ccls/member, use unadjusted RecordDecl (if there is forward declaration) and handle ClassTemplateSpecialization 2019-11-09 20:03:28 -08:00
Fangrui Song
2592dd41dd Add PreambleStatCache 2019-11-09 20:03:28 -08:00
Fangrui Song
31314555bb Use pthread if defined(__unix__) || defined(__APPLE__) 2019-11-09 20:03:28 -08:00
firstlove
9a79b2ece1 regard conversion as method instead of constructor 2019-11-09 20:03:28 -08:00
Fangrui Song
3337d3de8c Add $ccls/info 2019-11-09 20:03:28 -08:00
Fangrui Song
3c332b91de Clean 2019-11-09 20:03:28 -08:00
Fangrui Song
fa2234c894 Use non-inferred entries and build preamble for .h; index on didOpen if no pending requests; documentHighlight 2019-11-09 20:03:28 -08:00
Fangrui Song
083a629f90 Rename some initialization options
* Delete index.enabled which can be achieved with index.blacklist: ['.']
* Move completion.include* to completion.include.*
* move largeFileSize to highlight.largeFileSize
2019-11-09 20:03:28 -08:00
Fangrui Song
8d61b1aadb Revamp codeLens & codeAction
b.ref: references of bases
d.ref: references of derived
when b.ref > 0, don't display 0 ref or x bases
2019-11-09 20:03:28 -08:00
Fangrui Song
153e5c0dcc Construct SourceManager with UserFilesAreVolatile
Prettify pipeline
2019-11-09 20:03:28 -08:00
Fangrui Song
7eacd2664f Support textDocument/{formatting,onTypeFormatting,rangeFormatting} 2019-11-09 20:03:26 -08:00
Fangrui Song
ae19826411 Merge textDocument_did{Change,Close,Open,Save}.cc 2019-11-09 20:01:34 -08:00
Amos Bird
93b5fa198c Update threaded_queue.h (#82)
https://en.cppreference.com/w/cpp/language/fold
2019-11-09 19:58:32 -08:00
Fangrui Song
cff6c4714c Simplify semantic highlighting; improve hover of auto && 2019-11-09 19:58:32 -08:00
Fangrui Song
a3b982f5d7 Add index.trackDependency and improve pipeline 2019-11-09 19:58:32 -08:00
Fangrui Song
d9541c3222 Add index.initial{Blacklist,Whitelist}
index.{blacklist,whitelist}: disable indexes thoroughly
index.initial{Blacklist,Whitelist}: disable initial loading. will still be indexed after opening
2019-11-09 19:58:32 -08:00
Fangrui Song
d5f4f22508 Add GetAdjustedDecl to adjust Decl's that are missed by clangIndex 2019-11-09 19:58:32 -08:00
Fangrui Song
3334b2c4b7 Remove clang_utils.* 2019-11-09 19:58:32 -08:00
Fangrui Song
3dea9486b9 Misc
Move using below #include to make preamble happy
textDocument/references: if no references, first line or last line => list where this file is included
malloc_trim() only if files have been indexed in last cycle
Intern: use CachedHashStringRef
2019-11-09 19:58:32 -08:00
Riatre Foo
dc4f45b018 Allow force disabling snippet via client.snippetSupport 2019-11-09 19:58:32 -08:00
Fangrui Song
f82a436536 documentSymbol: ignore TypeParameter
Reported by Riatre
2019-11-09 19:58:32 -08:00
Riatre Foo
3abbca6474 Include macros in completion result 2019-11-09 19:58:32 -08:00
Fangrui Song
e24079366b Add kind to $ccls/member and iterate all QueryType::def
kind:2 => member functions
kind:3 => nested classes / namespace members
2019-11-09 19:58:32 -08:00
Fangrui Song
daa6fbf4b8 Misc 2019-11-09 19:58:32 -08:00
Fangrui Song
4ea0dee1c9 Fix spurious "Failed to index" errors 2019-11-09 19:58:32 -08:00
Fangrui Song
bf698b85d4 Publish diagnostics of inferred files and change diagnostics.{onChange,onOpen,onSave} from bool to debounce time 2019-11-09 19:58:32 -08:00
Riatre Foo
a5b8def411 Remove chunks with CK_Information kind from insertText. (#78)
Without this ccls inserts "size() const" in the following scenario:

std::string text;
text.si| <-- Trigger completion here and pick "size"
2019-11-09 19:58:32 -08:00
Fangrui Song
f0400fdcf2 Delete file_consumer.* 2019-11-09 19:58:32 -08:00
Fangrui Song
28401961ae Simplify semantic highlighting 2019-11-09 19:58:32 -08:00
Fangrui Song
d9f0de4719 Clean up FileConsumer and improve pipeline 2019-11-09 19:58:32 -08:00
Fangrui Song
110023483a Improve VarDef::type for textDocument/typeDefinition 2019-11-09 19:58:32 -08:00
Fangrui Song
569a7624a6 intern args 2019-11-09 19:58:32 -08:00
Fangrui Song
97e773081b intern strings in dependencies and IndexInclude::resolved_path 2019-11-09 19:58:32 -08:00
Fangrui Song
1249eb1eb0 Simplify pipeline and fix race 2019-11-09 19:58:32 -08:00
Fangrui Song
cffc8c8409 Add hierarchicalDocumentSymbolSupport 2019-11-09 19:58:32 -08:00
Fangrui Song
4b2f53aa5d Add clang.pathMappings to reuse cache files with differect source paths
Use `>` as the separator.
2019-11-09 19:58:32 -08:00