Commit Graph

10 Commits

Author SHA1 Message Date
Fangrui Song
73a9db338f Delay requests if the document has not not indexed
This fixes a plethora of "not indexed" errors when the document has not been indexed.

* Message handler throws NotIndexed
* The message is put into backlog and tagged with backlog_path
* path2backlog keeps backlog associated with a document and a merged index clears the backlog
* backlog[0] is forced to run if it becomes overdue
2018-12-24 21:05:14 -08:00
Fangrui Song
7682ccf6c6 Support textDocument/declaration & LocationLink
textDocument/{declaration,definition,typeDefinition} return either LocationLink[] or Location[]
Add an initialization option client.linkSupport . When it is false, ccls will return Location[] disregarding client's linkSupport.
`struct LocationLink` does not include originSelectionRange as it is wasteful.
2018-12-20 00:28:12 -08:00
Fangrui Song
771b55e279 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-20 00:28:12 -08:00
Fangrui Song
1200419303 codeAction: use codeActionProvider: CodeActionOptions and respect CodeActionParams::range 2018-12-20 00:28:12 -08:00
Fangrui Song
05b30265e5 Refactor ReplyOnce; error if InitializeParams.rootUri is null 2018-12-20 00:28:12 -08:00
Fangrui Song
da31c7d608 hierarchicalDocumentSymbol: support SymbolKind::Function declaration and uniquify by range
Also ensure selectionRange is a subrange of range, otherwise VSCode won't show the item.
Use detailed_name for 'detail'
2018-12-20 00:27:34 -08:00
Fangrui Song
8f9e1c4ae4 Reduce MAKE_REFLECT_STRUCT in lsp.hh
Position -> Pos; lsPosition -> Position
2018-12-11 15:04:00 -08:00
Fangrui Song
8a68dfbf8f Remove ls prefix from many LSP interfaces
Rename SymbolKind to Kind & lsSymbolKind to SymbolKind
Use textDocumentSync: TextDocumentSyncOptions
2018-12-11 15:04:00 -08:00
Fangrui Song
7817821959 *.h -> *.hh 2018-12-11 15:04:00 -08:00
Fangrui Song
77e1f354fd Refactor message handler and namespace ccls 2018-12-11 15:03:56 -08:00