Commit Graph

1802 Commits

Author SHA1 Message Date
Fangrui Song
125d00e2a5 Refactor serializer
Delete virtual bases Reader & Writer
Delete unused MAKE_REFLECT_STRUCT_WRITER_AS_ARRAY
Merge serializers/{json,binary}.hh into serializer.{hh,cc}
MAKE_REFLECT_STRUCT => REFLECT_STRUCT
MAKE_REFLECT_TYPE_PROXY => REFLECT_UNDERLYING
2018-12-03 09:37:29 -08:00
Fangrui Song
f7f7f5cc89 Add ReplyOnce::NotReady and error if didOpen is not seen
Use IgnoringDiagConsumer to override default TextDiagnosticPrinter
2018-12-02 23:22:21 -08:00
Fangrui Song
3fdcfb1f16 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.
2018-12-02 23:22:16 -08:00
Fangrui Song
6e464c289c completion: use Text for Macro{Instantiation,Definition} 2018-11-30 10:11:14 -08:00
Fangrui Song
c3b4b7f75f Fix ComputeGuessScore and delete dead code
Thanks to CXuesong
2018-11-27 21:34:33 -08:00
Fangrui Song
e97f01adb3 Merge maybe.hh into utils.hh 2018-11-27 21:34:33 -08:00
Fangrui Song
b8c370ac9a Merge query.hh and query_util.hh 2018-11-27 21:34:33 -08:00
Fangrui Song
f974c85efa Refactor Matcher to use pimpl and merge match.hh into utils.hh 2018-11-27 21:34:33 -08:00
Fangrui Song
f13a17ab3e Make EmptyParam empty & rewrite LruCache 2018-11-27 21:34:33 -08:00
Fangrui Song
3036f9f861 constexpr std::string_view -> const std::string_view
This works around gcc 7.2/clang rC347417 which have a bad interaction with libstdc++'s implementation of P0426
constexpr std::string_view also emits a string_view object in .rodata that cannot be optimized out by clang (which means larger object file size)

So use good old const.
2018-11-27 21:34:33 -08:00
Fangrui Song
f415e5e47c codeAction: use codeActionProvider: CodeActionOptions and respect CodeActionParams::range 2018-11-27 21:34:33 -08:00
Fangrui Song
b84bd9d060 Make DocumentLink::range narrower
Thanks to Riatre #135
2018-11-27 21:34:33 -08:00
Fangrui Song
7b14d857fd completion: delete insertText; don't set filterText if it is the same as label
It decreases Content-Length: from 32K to 25K for the following case:

 #include <bits/stdc++.h>
int main() { std::| }

Also

* make results deterministic when completion text is empty
* sort by newText, label, filterText
2018-11-27 21:34:33 -08:00
Fangrui Song
bad0fa5271 serializer: make visitor/vis value/v consistent 2018-11-27 21:34:33 -08:00
Fangrui Song
af4d81d387 Refactor ReplyOnce; error if InitializeParams.rootUri is null 2018-11-27 21:34:33 -08:00
Fangrui Song
eb75e053b9 indexer: handle DecltypeType and empty main file; diag: -Wno-unused-function for headers
Don't replace name with qualified name in Cls::*name
2018-11-27 21:34:26 -08:00
Fangrui Song
8c684c11c7 .ccls: add %objective-c %objective-cpp
Also allow multiple directives on a line, e.g. %c %cpp -DFOO
2018-11-22 20:16:52 -08:00
Fangrui Song
32469a3446 Use clang::isIdentifierBody and clean up utils/working_files 2018-11-22 20:16:49 -08:00
Fangrui Song
7ae32d740b hierarchicalDocumentSymbol: support SymbolKind::Function declaration and uniquify by range
Also ensure selectionRange is a subrange of range otherwise VSCode
won't show the item.
2018-11-17 16:13:17 -08:00
Fangrui Song
a1cebbd7ed README: add client feature table 2018-11-15 22:44:57 -08:00
Nikolaus Wittenstein
5cd28df6ef Add Apache LICENSE file (#121) 2018-11-13 20:25:59 -08:00
Dso Tsin
e98f7c020f Fix VS2017 build issues and add Appveyor CI script (#118) 2018-11-13 20:25:59 -08:00
Fangrui Song
ad8ee60707 Use SM.isInMainFile; suppress -Werror in preamble
SM.isInMainFile is to work around preamble bug: spurious err_pp_unterminated_conditional with circular #include
2018-11-13 20:25:59 -08:00
Fangrui Song
8e60ad4057 hierarchicalDocumentSymbol: display member function declarations 2018-11-13 20:25:59 -08:00
Fangrui Song
50f5dcc95c Fix some MSVC 2017 errors
Thanks to Dso Tsin!
2018-11-13 20:25:49 -08:00
Fangrui Song
826432b5d9 If clang >= 8, delete search path detection and use Sema::CodeCompleteIncludedFile 2018-11-12 20:39:47 -08:00
Fangrui Song
5774787173 Work around relative --sysroot= 2018-11-08 20:47:01 -08:00
Fangrui Song
376abc3dd9 Improve semantic highlight in templates 2018-11-07 17:20:41 -08:00
Fangrui Song
085a64b0ca Reduce MAKE_REFLECT_STRUCT in lsp.hh
Position -> Pos; lsPosition -> Position
2018-11-05 21:33:44 -08:00
Fangrui Song
c0b612395c Remove ls prefix from many LSP interfaces
Rename SymbolKind to Kind & lsSymbolKind to SymbolKind
Use textDocumentSync: TextDocumentSyncOptions
2018-11-05 14:13:16 -08:00
Fangrui Song
3b32cc6348 Misc 2018-11-04 08:42:12 -08:00
Fangrui Song
4bfb1fa70b Simplify and work around vscode _sortTextLow 2018-11-04 01:14:51 -07:00
Fangrui Song
8c7d982a3b project.cc: deduplicate more cases 2018-11-04 01:14:48 -07:00
Fangrui Song
29202a6e72 Fix EnumConstantDecl's kind & EnumDecl's vars 2018-11-01 20:28:52 -07:00
Fangrui Song
aa35a4cd3d textDocument/references workspace/symbol: add folders
For textDocument/reference, base/excludeRole/role has been lifted from params.context.* to params.*
2018-10-30 22:27:26 -07:00
Fangrui Song
fb1d117269 Report InvalidParams for serialization error 2018-10-30 22:26:50 -07:00
Fangrui Song
5af29566b8 Simplify and better compatibility with encodings retaining the feature of low bytes being 1-byte characters 2018-10-30 09:43:27 -07:00
Fangrui Song
ec8731932b *.h -> *.hh 2018-10-28 21:33:19 -07:00
Fangrui Song
123f504d50 Refactor message handler and namespace ccls 2018-10-28 21:18:45 -07:00
Fangrui Song
323d2ec8bf Implement textDocument/documentLink 2018-10-24 20:14:53 -07:00
Fangrui Song
e2478c8083 Implement textDocument/foldingRange 2018-10-24 17:48:44 -07:00
David F
cec7e3a419 Fix broken link in README.md (#101) 2018-10-24 17:48:44 -07:00
Fangrui Song
9b8947f304 Deprioritize completion items with additionTextEdits 2018-10-24 17:48:44 -07:00
Fangrui Song
6fc35ab866 Fix textDocument/implementation 2018-10-24 17:48:42 -07:00
Fangrui Song
e101e4782d Add command line option -index=root to index without starting language server 2018-10-22 22:34:49 -07:00
Fangrui Song
252b0d6606 Improve DeducedType 2018-10-19 14:44:29 -07:00
Fangrui Song
5814fbb4e5 Improve extent of definition/declaration; uniquify typeDefinition 2018-10-19 10:14:51 -07:00
Fangrui Song
5f98d5b993 Simplify 2018-10-16 01:14:43 -07:00
Fangrui Song
f8a6f75ff5 Add ExtentRef; merge symbol2refcnt and outline2refcnt
Fix hierarchical document symbol for namespaces when there are multiple declarations.
2018-10-16 01:14:43 -07:00
Fangrui Song
53632bd920 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
2018-10-16 01:14:43 -07:00