git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-11-07 18:34:24 +00:00
Родитель 597e7c380d
Коммит f8297f1512
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -161,10 +161,11 @@ clang_getCompletionChunkKindSpelling(enum CXCompletionChunkKind Kind) {
void print_completion_result(CXCompletionResult *completion_result,
CXClientData client_data) {
FILE *file = (FILE *)client_data;
int I, N;
fprintf(file, "%s:",
clang_getCursorKindSpelling(completion_result->CursorKind));
int I, N = clang_getNumCompletionChunks(completion_result->CompletionString);
N = clang_getNumCompletionChunks(completion_result->CompletionString);
for (I = 0; I != N; ++I) {
const char *text
= clang_getCompletionChunkText(completion_result->CompletionString, I);
@ -183,11 +184,13 @@ void perform_code_completion(int argc, const char **argv) {
char *filename = 0;
unsigned line;
unsigned column;
CXIndex CIdx;
input += strlen("-code-completion-at=");
if (parse_file_line_column(input, &filename, &line, &column))
return;
CXIndex CIdx = clang_createIndex(0, 0);
CIdx = clang_createIndex(0, 0);
clang_codeComplete(CIdx, argv[argc - 1], argc - 3, argv + 2,
filename, line, column, &print_completion_result, stdout);
clang_disposeIndex(CIdx);