Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string. Since extracting comments isn't free, a new code completion option is introduced. A new code completion option that enables including brief comments into CodeCompletionString should be a, err, code completion option. But because ASTUnit caches global declarations during parsing before even completion consumer is created, the option is duplicated as a translation unit option (in both libclang and ASTUnit, like the option to cache code completion results). llvm-svn: 159539
This commit is contained in:
@@ -387,9 +387,7 @@ void CompilerInstance::createCodeCompletionConsumer() {
|
||||
setCodeCompletionConsumer(
|
||||
createCodeCompletionConsumer(getPreprocessor(),
|
||||
Loc.FileName, Loc.Line, Loc.Column,
|
||||
getFrontendOpts().ShowMacrosInCodeCompletion,
|
||||
getFrontendOpts().ShowCodePatternsInCodeCompletion,
|
||||
getFrontendOpts().ShowGlobalSymbolsInCodeCompletion,
|
||||
getFrontendOpts().CodeCompleteOpts,
|
||||
llvm::outs()));
|
||||
if (!CompletionConsumer)
|
||||
return;
|
||||
@@ -415,16 +413,13 @@ CompilerInstance::createCodeCompletionConsumer(Preprocessor &PP,
|
||||
const std::string &Filename,
|
||||
unsigned Line,
|
||||
unsigned Column,
|
||||
bool ShowMacros,
|
||||
bool ShowCodePatterns,
|
||||
bool ShowGlobals,
|
||||
const CodeCompleteOptions &Opts,
|
||||
raw_ostream &OS) {
|
||||
if (EnableCodeCompletion(PP, Filename, Line, Column))
|
||||
return 0;
|
||||
|
||||
// Set up the creation routine for code-completion.
|
||||
return new PrintingCodeCompleteConsumer(ShowMacros, ShowCodePatterns,
|
||||
ShowGlobals, OS);
|
||||
return new PrintingCodeCompleteConsumer(Opts, OS);
|
||||
}
|
||||
|
||||
void CompilerInstance::createSema(TranslationUnitKind TUKind,
|
||||
|
||||
Reference in New Issue
Block a user