<div dir="ltr">Hello everyone,<div><br></div><div>I'm trying to add code completion support to my project.</div><div>For background, I'm working on Julia's C++ FFI [1], which</div><div>also allows the user to interactively enter C++ code, which is</div><div>where I'd like to support completion.</div><div><br></div><div>From looking at the code right now, it seems like one would set</div><div>the code completion point once, then run the parser as usual, for</div><div>which I'd then get results back through my set CodeCompletionConsumer.</div><div>Is that understanding correct so far?</div><div><br></div><div>If so, it seems like I'd have to create a new Preprocessor, Sema, etc.</div><div>every time I want to do completion. I don't think it is feasible for me in</div><div>an interactive context to go back and reparse everything with the new</div><div>Preprocessor etc. Ideally the new objects would just fall back to looking</div><div>up identifiers, macros etc. in the old instances, basically only maintaining</div><div>any new definitions added in the completion snippet. Is this possible?</div><div>It seems like I might be able to use External*Source. Is there any example of this?</div><div><br></div><div>Alternatively, I may be totally off base with the above interpretation, so I'd appreciate any advice on how to properly implement completion given that </div><div>I have an active CompilerInstance, PP, Sema, etc. that should already contain</div><div>everything needed for completion. I'd also be fine with not completing any definitions that are newly added in the completion snippet (in case that makes</div><div>things easier).</div><div><br></div><div>Thank you for your help,</div><div>Keno</div><div><br></div><div><br></div><div>[1] <a href="https://github.com/Keno/Cxx.jl">https://github.com/Keno/Cxx.jl</a></div></div>