[cfe-commits] r90300 - in /cfe/trunk: include/clang/Basic/SourceManager.h include/clang/Lex/Lexer.h include/clang/Lex/Preprocessor.h lib/Basic/SourceManager.cpp lib/Frontend/CompilerInstance.cpp lib/Lex/Lexer.cpp lib/Lex/Preprocessor.cpp

Douglas Gregor dgregor at apple.com
Wed Dec 2 14:42:45 PST 2009


On Dec 1, 2009, at 11:18 PM, Chris Lattner wrote:
>> +  /// \brief Specify the point at which code-completion will be  
>> performed.
>> +  ///
>> +  /// \param File the file in which code completion should occur. If
>> +  /// this file is included multiple times, code-completion will
>> +  /// perform completion the first time it is included. If NULL,  
>> this
>> +  /// function clears out the code-completion point.
>> +  ///
>> +  /// \param Line the line at which code completion should occur
>> +  /// (1-based).
>> +  ///
>> +  /// \param Column the column at which code completion should occur
>> +  /// (1-based).
>> +  ///
>> +  /// \returns true if an error occurred, false otherwise.
>> +  bool SetCodeCompletionPoint(const FileEntry *File,
>> +                              unsigned Line, unsigned Column);
>
> This should be moved to libfrontend, I consider this part of the  
> 'truncation' half of this.


I just had a "Duh!" moment about this... the preprocessor needs to  
know about code completion anyway, because we should be able to  
complete things like:

	#<list of preprocessor directives>
	#if defined(<list of things that are defined>
	#pragma <known pragmas>

	#define FOO(X, Y, Z)
	FOO(blah, <completion containing Y, Z)>

all of which are in the domain of the preprocessor. We just haven't  
tried to implement any code completions in the preprocessor yet.

	- Doug



More information about the cfe-commits mailing list