Commit Graph

1953 Commits

Author SHA1 Message Date
Ernest Borowski
468258d641 cmake: Fix rapidJSON version detection 2020-06-29 22:46:00 -07:00
Fangrui Song
6244594d71 indexer: log the number of errors and the first diagnostic
Example log:

```
15:47:45 indexer1         pipeline.cc:379 I parse /tmp/d/a.c error:1 use of undeclared identifier 'arg'
 clang /tmp/d/a.c --gcc-toolchain=/usr -working-directory=/tmp/d/
```
2020-06-28 17:16:35 -07:00
Fangrui Song
8cf8a3c4a4 Disable PCH reading/writing 2020-06-14 23:16:13 -07:00
Victor Sui
7a05f1ed06 cmake: Fail loudly when found rapidjson is too old (#646)
When the rapidjson found by cmake is an older version it defines a
variable RAPIDJSON_INCLUDE_DIRS instead of RapidJSON_INCLUDE_DIRS (#455).
According to #383 we do not want to make these older version work with
ccls. However currently if the rapidjson found by cmake is an older
version that defined RAPIDJSON_INCLUDE_DIRS, then the cmake invocation
still succeeds but any build command will fail because
RapidJSON_INCLUDE_DIRS was never set properly. This makes the cmake
invocation fail with a relevant error message in this event.
2020-06-14 23:15:48 -07:00
Ludovic Jozeau
c5acf62060 indexer: set the kind of static data members to Field instead of Var
Otherwise it is impossible to distinguish a static variable from a
static member variable.

Close #593
2020-04-22 09:08:20 -07:00
Fangrui Song
de800ebb70 sema_manager: report diagnostics in macro expansions
Fix #608
2020-04-19 11:27:57 -07:00
Fangrui Song
c10642d29b Delete ci/ and use .gitignore whitelist 2020-03-22 09:50:48 -07:00
Evan Klitzke
386f714f5e Set indexer threads' priority to ThreadPriority::Background (#538) 2019-12-02 19:20:39 -08:00
Fangrui Song
6c87a4656c project: decrease score if .c is matched against .hh (#549) 2019-12-22 10:06:34 -08:00
akocis
e373f9ed97 position: support line numbers larger than INT16_MAX (but <= UINT16_MAX) (#553) 2019-12-27 20:56:50 +01:00
Jan Lahoda
a2ecd9a8f0 textDocument/documentSymbol: support unopened files (#548) 2019-12-22 09:26:23 +01:00
xVan Turing
06a04d5102 indexer: add name for anonymous Enum 2019-11-16 05:42:51 +08:00
Felicián Németh
760f5e57ff initialize: implement serverInfo (LSP 3.15.0)
Return serverInfo for an initialize request. This helps clients to
identify ccls even when they just connect to a TCP port and allows them
to easily implement server specific functionalities like $ccls/navigate.
2019-11-11 10:19:24 +01:00
Fangrui Song
0a1e08a8ca indexer: fix getAdjustedDecl for explicit instantiations; fix incorrect short_offset_size=1 when name is empty
Fix #516
2019-11-09 13:27:09 -08:00
Fangrui Song
7e795e9b9e cmake: support CLANG_LINK_CLANG_DYLIB 2019-11-01 10:36:38 -07:00
Fangrui Song
0fe8a16504 Infer -target and --driver-mode from argv[0]
Fix #511
2019-10-31 22:31:03 -07:00
Fangrui Song
5935db10fd Fix some clang-tidy warnings
Incorporated some fixes by Daniel Chabrowski (#467)
2019-10-10 19:24:44 -07:00
Fangrui Song
2bffff7b0b Add initialization option completion.placeholder; change client.snippetSupport: false to drop ( and <
* client.snippetSupport: false => `foo`
* client.snippetSupport: true
  + completion.placeholder: false => `foo($1)$0` `bar<$1>()$0`
  + completion.placeholder: true => `foo(${1:int a}, ${2:int b})$0` `bar<${1:typename T}>()$0`

Note, client.snippetSupport is always false if the client does not support snippets.

Close #412
2019-10-06 23:54:45 -07:00
Fangrui Song
aa9668a8fc completion: don't reuse cache if the buffer line has changed
Fix emacs-ccls#54
2019-09-26 23:25:09 -07:00
Fangrui Song
0c6be472ce project: strip -Xclang <arg> 2019-09-11 19:05:04 -07:00
Fangrui Song
b3d694b8bd indexer: disable warnings and skip processed function bodies
Adapt clang rC370337: removal of createIndexingAction and WrappingIndexAction
2019-08-21 18:59:41 -07:00
Fangrui Song
65f86d0498 indexer: llvm::sys::fs::UniqueID -> clang::FileID
Fix a minor issue that an empty included file is not recorded.

Note, we need to skip invalid uid2lid_and_path because
otherwise lid2path may contain invalid entries with lid: 0,
which will cause the file entry with file_id 0 to have an empty path.
2019-08-21 23:46:02 -07:00
Fangrui Song
0f0e679edb indexer: delete redundant consumeFile 2020-04-21 21:43:56 -07:00
Fangrui Song
6717986541 Adapt llvmorg-11-init-1314-g777180a32b6: StringRef's conversion to std::string is now explicit
For compatibility with LLVM 7, the call sites have to be a bit verbose.
2020-01-29 00:29:06 -08:00
Fangrui Song
61a1071634 💥 Rename FunctionName -> functionName, VarName -> var_name 2019-08-22 10:12:03 -07:00
Fangrui Song
62fbde7873 textDocument/definition: don't jump to the type definition 2019-08-22 02:24:20 -07:00
Fangrui Song
50d7fbc235 project: allow absolute compilationDatabaseDirectory
Fix #466
2019-08-16 19:34:11 -07:00
Shengjing Zhu
0eebe0c1a9 Support override CLANG_RESOURCE_DIR
The result from clang commandline is something like
/usr/lib/llvm-7/lib/clang/7.0.1

Which means I need to recompile when the clang is upgraded to newer 7.x.x

However the system has a convenient symlink, which is
/usr/include/clang/7.
2019-08-11 18:06:47 +08:00
Fangrui Song
17dc4a6ecc Construct SourceManager with UserFilesAreVolatile
Fix #235. Close #453

In clang, it may be worth generalizing UserFilesAreVolatile (introduced in rC160074) to FilesAreVolatile.
2019-07-30 21:18:34 -07:00
Fangrui Song
a43e51f3bf project: improve ComputeGuessScore heuristics 2019-07-20 06:13:53 -07:00
Fangrui Song
ab6498e2ff Support indexing non-existent files in index.onChange:true mode 2019-07-20 01:16:15 -07:00
Fangrui Song
86a93b2d71 $ccls/fileInfo: optionally dump dependencies, includes and skipped_ranges 2019-07-20 02:24:07 -07:00
Riatre Foo
3dac492025 Change RequestId::value from int to std::string to allow non-numeric IDs. 2019-07-16 14:39:35 +08:00
Dan Čermák
795ad205d7 Only add include directories for LLVM, clang & rapidjson if they are not in CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include/c++/9 comes before /usr/include in `{clang,gcc} -v -fsyntax-only -xc++ /dev/null`.

    target_include_directories(ccls SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS})

If ${RapidJSON_INCLUDE_DIRS} resolves to /usr/include, /usr/include will
be shuffled before /usr/include/c++/9 and will cause `#include_next <stdlib.h>`
issues (see https://github.com/MaskRay/ccls/pull/417).

Check if the include directories are already in CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES.
2019-06-27 12:19:11 +02:00
Fangrui Song
c728fe9795 project: support %cu directive and strip -M* options 2019-06-27 19:11:38 -07:00
Fangrui Song
ab4b4efcaf pipeline: report changed arg 2019-06-27 01:41:25 -07:00
TÖRÖK Attila
b7027f89e5 threaded_queue.hh: fix -Wpessimizing-move (#409) 2019-06-18 08:45:20 +02:00
Fangrui Song
20883c047c utils.hh: work around MSVC STL bug 2019-06-17 23:42:48 -07:00
Fangrui Song
0d911077f4 Set Diag::concerned if any of its Notes is concerned 2019-05-12 09:03:58 -07:00
Fangrui Song
fd3e82b682 Refactor FindEntry and use best-fit .ccls
Fixes an issue with hierarchical .ccls found by Riatre in #384
2019-04-29 08:44:52 -07:00
Fangrui Song
94727b7eae JsonWriter: write "null" if VersionedTextDocumentIdentifier.version is null
Fix #387
2019-04-30 06:22:32 -07:00
Riatre Foo
aa2f55eb2b Append '/' before populating folder.dot_ccls 2019-04-28 19:11:10 +08:00
Fangrui Song
0951004370 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-04-11 22:26:07 -07:00
Fangrui Song
3a364c868b Set RetainRemappedFileBuffers to true
Reported by David Welch in #350.

This fixes double-free of llvm::MemoryBuffer when parsing fails.
2019-03-29 07:48:58 -07:00
Fangrui Song
4c871d9783 Add error checking of object deserialization; ignore non-object initializationOptions 2019-03-29 06:54:41 -07:00
Fangrui Song
4808ccb32c Add missing headers to adapt llvmorg-11-init-5501-g213aea4c583 and llvmorg-11-init-5528-gd7c5037e6b9 2020-03-12 08:35:59 -07:00
Fangrui Song
b0d42ad8f2 Adapt llvmorg-10-init-12036-g3b9715cb2193: handleDeclOccurence -> handleDeclOccurrence 2019-12-16 22:11:31 -08:00
Fangrui Song
a858567686 Adapt rL364464: clang::FrontendAction::Execute returns llvm::Error instead of bool 2019-06-27 01:10:04 -07:00
Fangrui Song
aab9dd6642 Simplify: hide unrelated options 2019-05-08 07:45:17 -07:00
Fangrui Song
34c5954420 Adapt clang rC358696: removal of OutputIsBinary 2019-04-18 19:16:24 -07:00