internal unsafe CodeCompletion(Interop.CompletionResult *native) { IntPtr completionString = native->completionString; Chunks = new Chunk[Interop.clang_getNumCompletionChunks(completionString)]; for (uint i = 0; i < Chunks.Count(); ++i) { Chunks[(int)i] = new Chunk( Interop.clang_getCompletionChunkKind(completionString, i), Interop.clang_getCompletionChunkText(completionString, i).ManagedString); } Priority = Interop.clang_getCompletionPriority(completionString); Availability = Interop.clang_getCompletionAvailability(completionString); Annotations = new string[Interop.clang_getCompletionNumAnnotations(completionString)]; for (uint i = 0; i < Annotations.Count(); ++i) { Annotations[(int)i] = Interop.clang_getCompletionAnnotation(completionString, i).ManagedString; } Comment = Interop.clang_getCompletionAnnotation(completionString).ManagedString; }