Commit Graph

84 Commits

Author SHA1 Message Date
Yu Zeng
aca02d209b Fix compile error when use msvc 2019 (#754)
See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
2021-01-18 19:05:28 -08:00
Fangrui Song
125915e254 Adapt llvmorg-12-init-946-g10b1b4a231a: add find_package(ZLIB) 2020-07-25 08:30:18 -07:00
Ernest Borowski
468258d641 cmake: Fix rapidJSON version detection 2020-06-29 22:46:00 -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
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
7e795e9b9e cmake: support CLANG_LINK_CLANG_DYLIB 2019-11-01 10:36:38 -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
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
Paul Smith
b6155ddf73 Enhance the output of --version with Git describe results. (#342) 2019-03-23 20:24:10 -04:00
Fangrui Song
7c70c0662f 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-03-09 19:45:37 -08:00
Fangrui Song
478f849ada cmake: add option to use system rapidjson if exists 2019-03-08 22:46:43 -08:00
Fangrui Song
9bbb288b57 cmake: delete SYSTEM_CLANG and auto-download mechanism 2019-01-22 22:44:13 +08:00
Fangrui Song
c6d56519e3 Drop support for clang 6 2019-01-21 10:44:44 +08:00
Fangrui Song
e3133bea90 cmake_minimum_required 3.8; clean up 2019-11-09 20:09:13 -08:00
Fangrui Song
9ad2450009 Refactor WorkingFiles and CompletionManager
* 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.
2019-11-09 20:09:13 -08:00
Fangrui Song
880c515d64 Merge query.hh and query_util.hh 2019-11-09 20:09:13 -08:00
Fangrui Song
d6dd932e6d Refactor Matcher to use pimpl and merge match.hh into utils.hh 2019-11-09 20:09:13 -08:00
Dso Tsin
e5f7a938b5 Fix VS2017 build issues and add Appveyor CI script (#118) 2019-11-09 20:09:13 -08:00
Fangrui Song
3cd0ee2fc7 Refactor message handler and namespace ccls 2019-11-09 20:09:11 -08:00
Fangrui Song
8fa853c321 Implement textDocument/documentLink 2019-11-09 20:03:28 -08:00
Fangrui Song
617cdd89de Implement textDocument/foldingRange 2019-11-09 20:03:28 -08:00
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
49dd0ed558 Support workspace folders 2019-11-09 20:03:28 -08:00
Fangrui Song
3337d3de8c Add $ccls/info 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
Fangrui Song
3334b2c4b7 Remove clang_utils.* 2019-11-09 19:58:32 -08:00
Fangrui Song
f0400fdcf2 Delete file_consumer.* 2019-11-09 19:58:32 -08:00
Fangrui Song
62d0c49b0a Rename hierarchies to $ccls/{call,inheritance,member}
bool flat = false; -> bool hierarchy = false; (set it to true to enable hierarchical view)

Delete $ccls/callers (which is what $ccls/call does now)
2019-11-09 19:58:32 -08:00
Fangrui Song
f939b6cc44 Make $ccls/reload reset DB and reload cached index files
$ccls/reload is renamed from $ccls/freshenIndex

This is useful when DB (merged index) diverges from backing IndexFile.

Also fix a semantic highlighting bug.
2019-11-09 19:58:32 -08:00
Fangrui Song
ce72cf7bd9 Remove $ccls/base and clean up; deduplicate codeLens 2019-11-09 19:58:32 -08:00
Fangrui Song
d864f969ad Add $ccls/navigate and improve textDocument/definition 2019-11-09 19:58:29 -08:00
Fangrui Song
b794b3606f Add LLVM_ENABLE_RTTI (default: OFF) to allow linking against Arch Linux extra/{llvm,clang} (-DLLVM_ENABLE_RTTI=ON) 2019-10-24 01:01:21 -07:00
Riatre Foo
87f36a4a96 Fix compile on Windows + MSYS2-MinGW64 (#46)
1. libClangDriver.a shipped by MSYS2 needs -lversion which is not
   included in CMAKE_CXX_STANDARD_LIBRARIES by default.
2. Use string literal for DEFAULT_RESOURCE_DIRECTORY to support
   backslashes in path.
2019-10-24 01:01:21 -07:00
Fangrui Song
af881dff18 cmake: for -DSYSTEM_CLANG=off, 6.0.0 -> 6.0.1 2019-10-24 01:01:21 -07:00
Fangrui Song
1c0bf0af65 Add textDocument/codeAction for clang FixIt
What do you think of the challenge ccls-fringe in Real World CTF?
2019-10-24 01:01:21 -07:00
Chao Shen
f87ee1323c Misc. 2019-10-24 01:01:20 -07:00
Fangrui Song
d3536831c3 Fix FreeBSD build with -DUSE_SHARED_LLVM=off 2019-10-24 01:01:20 -07:00
Fangrui Song
7ad03c22bd cmake: remove -lc++experimental -ldl -lexecinfo 2019-10-24 01:01:20 -07:00
Fangrui Song
32dad17e81 Remove submodule doctest 2019-10-24 01:01:20 -07:00
Fangrui Song
2682964039 Rename message files (e.g. ccls_call_hierarchy.cc -> ccls_callHierarchy.cc) 2019-10-24 00:17:28 -07:00
Fangrui Song
1830103ec6 Internalize strings & remove diagnostics_publisher.cc 2019-10-24 00:17:28 -07:00
Fangrui Song
732e002b13 Infer system include paths from CompilerInvocation 2019-10-24 00:17:28 -07:00
Fangrui Song
d165a0b0ea Use clang::PrintingPolicy and remove type_printer 2019-10-24 00:17:28 -07:00
Fangrui Song
f0559bba54 Remove Timer and PerformanceImportFile 2019-10-24 00:17:28 -07:00
Fangrui Song
34dc1e93e9 Remove WithFileContent & lex_utils.{cc,h} 2019-10-24 00:17:28 -07:00
Fangrui Song
bb08fdfa02 Remove $ccls/random; remove DB::symbols; decrease DB::entities grow rate 2019-10-24 00:17:25 -07:00
Fangrui Song
a962061698 Simplify pipeline 2019-10-23 21:56:51 -07:00
Fangrui Song
cf0d16fa0c Replace loguru with a custom logger 2019-10-23 21:56:51 -07:00