Commit Graph

15 Commits

Author SHA1 Message Date
Fangrui Song
2bffff7b0b Add initialization option completion.placeholder; change client.snippetSupport: false to drop ( and <
* client.snippetSupport: false => `foo`
* client.snippetSupport: true
  + completion.placeholder: false => `foo($1)$0` `bar<$1>()$0`
  + completion.placeholder: true => `foo(${1:int a}, ${2:int b})$0` `bar<${1:typename T}>()$0`

Note, client.snippetSupport is always false if the client does not support snippets.

Close #412
2019-10-06 23:54:45 -07:00
Fangrui Song
61a1071634 💥 Rename FunctionName -> functionName, VarName -> var_name 2019-08-22 10:12:03 -07:00
Fangrui Song
17eaca8a02 Add initialization option index.initialNoLinkage: false
By default, the background indexer doesn't handle names of no linkage.
They are indexed when their files are opened. This saves memory and
makes cache files smaller.
2019-03-24 23:42:00 -07:00
Fangrui Song
e576df4f6f Add initialization option index.name.suppressUnwrittenScope (default: false) 2019-03-10 08:55:01 -07:00
Fangrui Song
dbf7d8eb41 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-03-10 00:27:50 -08:00
Fangrui Song
6a3cff6e50 Make clang.excludeArgs accept glob patterns 2019-03-04 18:21:53 -08:00
Fangrui Song
f35883f9b4 indexer: index TemplateTypeParmDecl and ParmVarDecl in declarations for clang >= 9
Index ParmVarDecl in declarations if index.parametersInDeclarations is true

And support some unhandled Decl::Kind
2019-02-22 10:59:05 +08:00
Fangrui Song
0c04c27e59 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-02-21 23:46:20 +08:00
Leszek Swirski
633d8936a8 Use DiagnosticRelatedInformation if client supports publishDiagnostics.relatedInformation (#276)
In clients that support DiagnosticRelatedInformation, display
clang notes as these nested diagnostics rather than appending
them to the parent diagnostic's message. Behaviour for clients
that don't support related information should be unchanged.
2019-02-21 02:23:21 +01:00
Fangrui Song
3bf921b3bd Add initialization option capabilities.* and index.maxInitializerLines
indexer.cc: use index.maxInitializerLines instead of kInitializerMaxLines

messages/initialize.cc: some ServerCapabilities are toggable:

documentOnTypeFormattingProvider.firstTriggerCharacter
foldingRangeProvider
workspace.workspaceFolders.supported
2019-02-10 18:17:07 +08:00
Fangrui Song
8835a555f8 Delay requests if the document has not not indexed (#176)
This fixes a plethora of "not indexed" errors when the document has not been indexed.

* Message handler throws NotIndexed if not overdue
* The message is put into backlog and tagged with backlog_path
* path2backlog[path] tracks backlog associated with document `path`
* The backlog is cleared when the index is merged
* backlog[0] is forced to run if it becomes overdue
2019-11-09 20:09:13 -08:00
Fangrui Song
49ae9e8912 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.
2019-11-09 20:09:13 -08:00
Fangrui Song
a47fb42e30 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
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
bbce333042 *.h -> *.hh 2019-11-09 20:09:13 -08:00