Commit Graph

160 Commits

Author SHA1 Message Date
Fangrui Song
86768b7d36 [formatting] textDocument/rangeFormatting 2017-12-31 20:03:43 -08:00
Fangrui Song
12ad0303be [formatting] Add textDocument/rangeFormatting 2017-12-31 19:41:47 -08:00
Fangrui Song
f9aa0ef66d [formatting] Refrain from std::make_unique until migration to C++14 or C++17 2017-12-31 15:56:02 -08:00
Fangrui Song
cd2f3c1e45 [formatting] Rename formattingOptions to options
LanguageClient-neovim `:call LanguageClient_formatting()` works now
2017-12-31 15:46:28 -08:00
Daniel Martín
f389d294b7 Protect formatting code inside USE_CLANG_CXX 2017-12-31 23:15:03 +01:00
Daniel Martín
05e9bf3966 Add missing includes 2017-12-31 13:30:34 +01:00
Daniel Martín
0e16899b81 Move formatting structs to text_document_formatting.cc 2017-12-31 13:30:34 +01:00
Daniel Martín
19341c18cd Basic implementation of document formatting
Still some important TODOs to address:

- Improve the algorithm that converts between offsets and line/column
  pairs. Right now it's extremely naive.
- Add proper support for a .clang-format file that specifies
  the coding style.
2017-12-31 13:30:34 +01:00
Daniel Martín
abc2edf05f Add structures to support document formatting 2017-12-31 13:24:58 +01:00
scturtle
4c2dff39ef Response "being indexed" instead of "not found". 2017-12-30 19:39:10 -08:00
Chao Shen
829b2fe18c Better order of the completion items. 2017-12-30 15:15:46 +08:00
Jacob Dufault
6048eb6237 Move LoadCachedFileContents into ICacheManager 2017-12-29 12:19:39 -06:00
Jacob Dufault
71591d7805 Index_Request::contents is no longer optional 2017-12-29 12:00:52 -06:00
Jacob Dufault
a10bb50f51 Begin cache restructure so it can be tested 2017-12-29 12:00:52 -06:00
Jacob Dufault
c596e55dcc Cleanup some includes. 2017-12-29 12:00:52 -06:00
Jacob Dufault
b6071004df Rename IndexMain to Indexer_Main 2017-12-29 12:00:52 -06:00
Jacob Dufault
59e79b3c42 Move entry_points.h into import_pipeline.h 2017-12-29 09:52:43 -06:00
Jacob Dufault
36e7fa9a76 More work on e2e tests 2017-12-29 09:39:10 -06:00
Fangrui Song
6636617b4d [comments] Import mpark/variant and make MarkedString a variant (#200) 2017-12-28 15:21:40 -08:00
Jacob Dufault
7939aec743 Remove WorkThread::Result.
WorkThread::StartThread is now a more typical main function.
2017-12-28 09:20:21 -08:00
Jacob Dufault
243630ca2e wip 2017-12-28 08:55:46 -08:00
Jacob Dufault
b8e7a5bcb3 Format code 2017-12-27 07:54:46 -08:00
Chao Shen
a84c863e5e Filter some completion results based on the input. 2017-12-27 09:34:24 -06:00
Fangrui Song
3df71f4145 [hover] Change the first MarkedString's language to "text" 2017-12-25 21:48:28 -08:00
Fangrui Song
5a22a5cc66 [hover] Return comments and hover as two MarkedString's
Inspired by @romix's https://github.com/jacobdufault/cquery/pull/187
2017-12-25 21:31:01 -08:00
romix
03b50ea3cc Serialize decl comments and use them in GetHoverForSymbol 2017-12-24 18:01:38 -08:00
Fangrui Song
6a8537c2bf Handle function references in templates. fix #174 (#184) 2017-12-24 10:27:17 -08:00
Fangrui Song
cdcf75ac84 Raise maxWorkspaceSearchResults to 500 and sort results even if the max number has been reached 2017-12-23 22:49:45 -08:00
Fangrui Song
b52ec9070c [workspace/symbol] Use short_name for sorting and detailed_name for displaying results 2017-12-23 21:27:01 -08:00
Fangrui Song
24f428c670 [workspace/symbol] Sort candidates with a fuzzy matching algorithm (#182) 2017-12-23 19:23:29 -08:00
scturtle
cb7ccbe543 Change var.def.is_* to enum. 2017-12-23 19:29:32 -06:00
Jacob Dufault
f6d84cd68c Merge IpcManager and QueueManager 2017-12-23 16:25:18 -08:00
Jacob Dufault
64f094d347 Move BuildWorkspaceEdit to text_document_rename.cc 2017-12-23 15:41:09 -08:00
Jacob Dufault
fb491e6c6d Format using clang format 4.0.0 2017-12-23 08:33:26 -08:00
Fangrui Song
c3c0feecb2 [indexer] Make hover optional (#176)
On textDocument/hover requests, return `detailed_name` if `hover` is unavailable
Don't include leading `type_name` in `detailed_name` for CXIdxEntityEnumConstant, i.e. `Foo Foo::a` -> `Foo::a`
2017-12-22 14:48:55 -08:00
Fangrui Song
3410f9769c textDocument/definitions: on a variable definition, get both declarations and variable_type definition. 2017-12-20 10:59:14 -08:00
Jacob Dufault
b9a2b68e93 Never elide result response for hover. 2017-12-18 23:54:00 -08:00
Jacob Dufault
7e9db4a2da Send null hover response if there is no hover. 2017-12-18 23:27:52 -08:00
Fangrui Song
18f602c6e8 For textDocument/hover, do not error on empty results 2017-12-18 23:21:30 -08:00
Jacob Dufault
8098e4f01d Support multiple base functions. 2017-12-18 22:15:46 -08:00
Jacob Dufault
b4e8f8dd4f Don't show idle status while loading compile_commands.json/project. 2017-12-18 21:36:48 -08:00
Jacob Dufault
a7d1c6917f Report detailed name for workspace symbol search.
This fixes vscode filtering which fixes qualified name global symbol search.
2017-12-18 21:31:19 -08:00
Jacob Dufault
be961fc4f2 Add hover (instead of reusing detailed_name) 2017-12-18 21:20:00 -08:00
Riatre Foo
0045e4817c Windows build script (#154)
* Cast from float explicitly.

* Upgrades to waf 2.0.2.

For VS2017 support on Windows.

* [waf] Supports building on Windows.

Needs 7z.exe in PATH for extracting prebuilt clang NSIS installer (when
using bundled clang).
RPATH is "emulated" by putting a libclang.dll alongside the cquery
binary.
Tested with Visual Studio 2017 toolchain.

* [waf] Fix default_resource_directory on Windows + system clang.

* Add AppVeyor configuration
2017-12-17 10:14:30 -08:00
Jacob Dufault
d23de3a9fb Move default resource directory computation to utils.
This will be used by the test system as well.
2017-12-15 21:18:49 -08:00
Jacob Dufault
9f249970b0 Ensure DEFAULT_RESOURCE_DIRECTORY is a string. 2017-12-15 21:06:27 -08:00
Chen
f3f7bc26cd Better default resource dir heuristics: use system resource dir with system clang and relative path to resource dir with bundled clang (#137) 2017-12-14 14:35:21 -08:00
Jacob Dufault
9b909b3a13 Move usr out of *Def and into Query*/Index* types.
I'd like to make the *Def structures optional in the future, and usr is always non-optional.
2017-12-11 23:57:44 -08:00
Jacob Dufault
2751f51956 Format 2017-12-11 21:21:03 -08:00
Jacob Dufault
12bfabf9c2 No more NonElidedVector 2017-12-11 21:20:29 -08:00
Jacob Dufault
ae8cae5ba6 Do not index files starting with git: 2017-12-06 17:00:19 -08:00
Jacob Dufault
0e4148518a Fix clang 3.8 build 2017-12-06 09:10:58 -08:00
Jacob Dufault
ae40bfa208 Add override 2017-12-06 07:10:19 -08:00
Jacob Dufault
7a5eb3c4d5 Move src/messages/*.cc to anonymous namespace 2017-12-05 21:03:38 -08:00
Jacob Dufault
b65a30c3f7 Move Ipc_* types into messages/ 2017-12-05 20:41:44 -08:00
Jacob Dufault
5093863b33 Move initialization Ipc structures into messages/ 2017-12-05 20:09:12 -08:00
Jacob Dufault
9a3e040bf8 Fix clang build 2017-12-05 19:49:16 -08:00
Jacob Dufault
b441a90e0d Finish migrating to messages/ 2017-12-05 19:46:36 -08:00
Jacob Dufault
905a4ab2b1 Make IpcId::Exit handled as a message. 2017-12-05 00:21:19 -08:00
Jacob Dufault
3599a831b1 Introduce MessageHandler abstraction. Mainly just code reorg.
Only the initialize request uses it so far, but this will enable pulling
quite a bit of code out of command_line.cc.
2017-12-04 23:57:41 -08:00