Commit Graph

92 Commits

Author SHA1 Message Date
Fangrui Song
4e10504a6d 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-05-13 00:26:55 -07:00
Fangrui Song
977e14c862 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-05-13 00:26:55 -07:00
Fangrui Song
05d1fbfc5b 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-05-13 00:26:55 -07:00
Fangrui Song
5a723b489a Refactor Matcher to use pimpl and merge match.hh into utils.hh 2019-01-12 00:40:49 +08:00
Fangrui Song
8c73bbc3c7 Use clang::isIdentifierBody and clean up utils/working_files 2019-01-09 15:19:23 +08:00
Fangrui Song
df20969788 *.h -> *.hh 2019-01-09 15:19:23 +08:00
Fangrui Song
ea1271a84e Refactor message handler and namespace ccls 2019-01-09 15:19:23 +08:00
Fangrui Song
28d33324b1 Publish diagnostics of inferred files and change diagnostics.{onChange,onOpen,onSave} from bool to debounce time 2018-09-23 10:40:39 -07:00
Fangrui Song
41756297ef Simplify semantic highlighting 2018-09-20 17:49:39 -07:00
Fangrui Song
f9bd84a975 Clean up FileConsumer and improve pipeline 2018-09-20 09:20:07 -07:00
Fangrui Song
58191fd335 Support empty cacheDirectory and fix cache load 2018-09-08 15:46:52 -07:00
Fangrui Song
f3490a3e6c Add license notice 2018-08-20 22:27:52 -07:00
Fangrui Song
8cbb317dc2 clang-format
DEF CON 26 CTF
2018-08-09 10:13:54 -07:00
Fangrui Song
df02c29a7d clangIndex 2018-07-08 00:34:31 -07:00
Fangrui Song
0decb01a0f Add Config->reparseForDependency
Specify 1 if for large projects you don't want to reparse dependents at load time when a common .h changes.
2018-06-02 00:57:18 -07:00
Fangrui Song
39a17a9fd7 Remove WithFileContent & lex_utils.{cc,h} 2018-05-31 21:07:59 -07:00
Fangrui Song
c9f0b65062 Simplify pipeline 2018-05-28 16:13:44 -07:00
Fangrui Song
8fabe3d1ae Replace loguru with a custom logger 2018-05-27 15:14:33 -07:00
Fangrui Song
f145c4422f experimental/filesystem -> LLVM/Support/FileSystem.h; sparsepp -> DenseMap 2018-05-13 15:24:04 -07:00
Fangrui Song
d3a36a4ae6 Use llvm::cl and simplify main.cc import_pipeline.cc 2018-05-13 12:08:33 -07:00
Fangrui Song
ccb5cba720 . 2018-05-04 09:45:35 -07:00
Fangrui Song
d821ac34d8 Merge {timestamp_manager,iindexer}.{cc,h}; remove standard_includes.*; use last_write_time 2018-04-28 23:37:55 -07:00
Fangrui Song
6e68e9edbd Simplify 2018-04-07 21:04:20 -07:00
Fangrui Song
992b3cce16 Use clang_File_tryGetRealPathName 2018-04-07 16:46:22 -07:00
Fangrui Song
46fc3b8323 . 2018-03-31 16:30:53 -07:00
Fangrui Song
9aca6119ed . 2018-03-31 13:38:43 -07:00
Fangrui Song
233e377137 . 2018-03-31 11:27:28 -07:00
Fangrui Song
6c8fee4141 . 2018-03-31 09:47:27 -07:00
Fangrui Song
da649891ae Resurrection of ccls 2018-03-30 22:02:26 -07:00
Fangrui Song
512cd8cbd3 Better textDocument/definition heuristic for T::name style dependent names 2018-03-29 22:36:54 -07:00
Fangrui Song
bee8bacefd Speed up build 2018-02-23 18:24:54 -08:00
Jacob Dufault
01fe19f280 Format code 2018-02-21 23:34:32 -08:00
Fangrui Song
72e654ffed Fix default -resource-dir when clang -print-resource-dir contains ..
Also makes textDocument/definition in comments takes scope resolution
into account, and use detailed names (for Func, without parameters) for workspace/symbol
2018-02-12 23:54:50 -08:00
Fangrui Song
55c7519e93 Move ImportOrUpdate and header cleanup 2018-02-06 21:27:07 -08:00
Riatre Foo
54c587a700 Look for .cquery in any directory above the source file in the hierarchy. (#409)
* Look for .cquery in any directory above the source file in the hierarchy.

Currently cquery only reads compiler arguments (.cquery) from project
root. Under some circumstances (e.g. remote compiling), generating a
compilation database with correct path in it is non-trivial, and
allowing per directory compile arguments usually helps.

* unused var buf
2018-02-03 13:16:38 -08:00
Riatre Foo
b145243a64 Fix #393 again. (#402)
28cd33e actually changed the behaviour of GetFilesInFolderHelper.
2018-02-02 10:51:14 -08:00
Fangrui Song
12e41c609e Fix #393 2018-02-01 23:35:34 -08:00
Chao Shen
5b6945d909 Remove last CR. 2018-02-01 17:12:36 +08:00
Jacob Dufault
f6a2a55209 Import pipeline improvements
- Cache manager is created by request
- Index is always associated with its contents
- Reduced frequently of file reads
2018-01-29 21:34:36 -08:00
Jacob Dufault
a392301be3 Format 2018-01-29 16:27:43 -08:00
Jacob Dufault
e20a6e9790 Add siphash.h, HashUSR -> HashUsr 2018-01-14 13:18:12 -08:00
Fangrui Song
eec5c77d6a Use Paul Heckel's diff algorithm to convert between buffer/index line number 2018-01-14 00:23:04 -08:00
Jacob Dufault
93ba0c532b For completion, only tell clang about relevant dirty working files.
The heuristic may not be perfect, but it is probably good enough.
clang_codeCompleteAt seems to get slower as more and more CXUnsavedFile
instances are uploaded.
2018-01-12 09:39:05 -08:00
Fangrui Song
6fb1798692 Use @ as escape character of cache filenames
Fixes #112
2018-01-10 23:57:42 -08:00
Jacob Dufault
54394ed868 Format 2018-01-10 18:43:01 -08:00
Jacob Dufault
5605dfbb00 Always normalize project file entry when passing it to clang.
This makes clang_codeCompleteAt much faster.
2018-01-10 18:33:36 -08:00
Joel Hock
9d64a76fec fix logic in GetFilesInFolderHelper from DFS-ification in 96f4ffc4b 2018-01-08 19:38:37 -08:00
yshui
b644b54614 Convert GetFilesInFolderHelper to use BFS (#268)
This function has a huge stack frame (> 8k, thanks to tinydir), and is
called recursively. I have seen this function causing some stack
overflows. So convert it to BFS to avoid that.
2018-01-08 09:09:19 -08:00
Jacob Dufault
a4496b7430 Do not try to load compile_commands.json if there is a .cquery file.
Also give some better diagnostics for .cquery.
2018-01-06 20:27:50 -08:00
Jacob Dufault
bbe11e32eb Prefer WriteToFile over manual std;:ofstream usage. 2018-01-05 10:02:53 -08:00