<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 20 Jun 2017, at 09:27, Manuel Klimek <<a href="mailto:klimek@google.com" class="">klimek@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">First, thanks for proposing this - this fits pretty much exactly with what we had envisioned / slowly started working towards, so big thumbs up :) <div class=""><br class=""></div><div class="">Others have already made a lot of interesting observations / points, adding a couple of thoughts inline.<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Jun 16, 2017 at 1:57 AM Alex Lorenz <<a href="mailto:aleksei_lorenz@apple.com" class="">aleksei_lorenz@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Hi,</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">This is a proposal for a new Clang-based refactoring engine (as indicated by Duncan last week<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">[</span>1<span style="color: rgb(149, 126, 53);" class="">]</span>). The new refactoring engine should be based on both the existing code from<span class="Apple-converted-space"> </span><a href="http://llvm.org/" target="_blank" class="">llvm.org</a><span class="Apple-converted-space"> </span>and the code that I've just committed to<span class="Apple-converted-space"> </span><a href="http://github.com/apple/swift-clang" target="_blank" class="">github.com/apple/swift-clang</a><span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">[</span>2<span style="color: rgb(149, 126, 53);" class="">]</span><span class="Apple-converted-space"> </span>(Please note that it has some outdated designs and APIs that I'd like to replace). This email is split into three different sections:</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>The first section lists the refactoring actions supported by Xcode 9.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>The second section describes the actual proposal.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>The third section outlines an action plan that I would like to follow when submitting patches for the new refactoring engine.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I'm looking forward to any feedback that you might have!</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 25px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">#<span class="Apple-converted-space"> </span></span>Background</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">At first I would like to provide a little bit of background on the C++/Objective-C refactorings in Xcode. Xcode 9 contains a Clang-based refactoring engine that supports several refactoring operations. The primary operation that it supports is “Rename”. The refactoring engine gathers the renamed symbol occurrences using two distinct mechanisms:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Local rename. It gathers occurrences for declarations that are declared in a function's body. It is based on existing code from<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-rename</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>that was moved over to Clang's<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Tooling</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>library. It was then modified slightly to fit our goals. I also added support for some Objective-C declarations.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Global rename. It gathers occurrences for all other declarations. We decided to put the high-level logic for global rename into Xcode's indexer because Xcode had to support cross-language rename (between Swift and Objective-C). The indexer uses the core engine in Clang’s lib/Index, so Clang is still very much involved in this process. The indexer also delegates low-level “indexed-file” renames to Clang. This lets us gather occurrences for symbolic references that don't have the full location information (like Objective-C selector names), textual matches for occurrences of a matching string in comments, and textual matches for a matching filename in the<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">#include</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>directives.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Xcode 9 also support some local refactoring actions:</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Extract function/method.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Extract duplicate expression.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Add missing switch cases (GIF:<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/file/data/q2qz53jd7ug4cpx4zlfx/PHID-FILE-aq75y26bgkfvm5e775jt/switchCases" target="_blank" class="">https://reviews.llvm.org/file/data/q2qz53jd7ug4cpx4zlfx/PHID-FILE-aq75y26bgkfvm5e775jt/switchCases</a>). It is also available as a fixit.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>[C++] Fill-in method stubs from abstract base classes.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Convert if to switch.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>[ObjC] Fill in protocol stubs. It is also available as a fixit.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>[ObjC] Wrap in NSLocalizedString</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Another action that Xcode supports is called “Generate Missing Function Definitions” (GIF:<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/file/data/u4kzt62wjdin5dpl65jl/PHID-FILE-w7jl2vz42b5aybd6oizj/generateFunctionDefinitions" target="_blank" class="">https://reviews.llvm.org/file/data/u4kzt62wjdin5dpl65jl/PHID-FILE-w7jl2vz42b5aybd6oizj/generateFunctionDefinitions</a>). This action actually depends on the indexer to determine the set of methods that have to be implemented and where should the generated code go. It’s also the one and only cross-TU refactoring action that is currently supported (without taking "rename" into account).</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 25px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">#<span class="Apple-converted-space"> </span></span>Refactoring Engine Proposal</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I would like to create a new refactoring engine that will go into Clang's<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Tooling</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>library. The engine's API should be designed with different use cases in mind, and I would like to ensure that the engine accommodates the following three use cases:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Libclang. It should provide a C-based refactoring API that we can use in Xcode.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Clangd.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>A standalone refactoring tool,<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span>. This tool will be used for testing. It will also allow users to perform refactoring actions without using other tools.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">The engine should try to follow the following high level goals:</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>It should be easy for others to create, test, and integrate new local refactoring operations.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Refactoring operations should be allowed to fail. The engine should have good error reporting mechanisms.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Initiation via source selection should be quick (if we assume that we have access to a parsed AST) as we'd like to let a user know which actions are available as soon as possible.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>The engine should allow at least a basic level of configurability and customization (users should be able select options for a refactoring action if an action chooses to provide some). In the future we might also want to provide more powerful configuration mechanisms that will allow IDEs to generate custom UIs for different actions.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 19px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">##<span class="Apple-converted-space"> </span></span>Initiation</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I think that there are two equally important modes of initiation that should be supported by Clang's refactoring engine:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Initiation via source selection. This mode is important for IDEs.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Initiation via AST queries. This mode is important for standalone tools / scripts that want to refactor an entire project.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Unfortunately our code doesn't provide a good enough abstraction that generalizes well for different actions. I'm still hashing out a better initiation scheme, and I will send a separate RFC with our proposal for initiation in the near future. Let me know if you have any ideas/suggestions!</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 19px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">##<span class="Apple-converted-space"> </span></span>Refactoring</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I would like to propose keeping the two modes that were previously described for the "Rename" operation. This will probably mean that a standalone tool like<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>won't support the global rename mode of rename. On the other hand, if Clangd will gain some form of indexing infrastructure (which seems likely given the recent interest in indexing<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">[</span>3<span style="color: rgb(149, 126, 53);" class="">]</span>), it will be able to use the engine's global renaming infrastructure as well. I'm hoping the community will provide some input on what should happen to<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-rename</span><span style="color: rgb(149, 126, 53);" class="">`</span>, as I'm not sure whether it should stay or be deprecated in favour of new tools.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Other refactoring operations will primarily work with source modifications. I think that the refactoring engine should provide a set of shared utility components that can be reused by different operations. For example, things like return type deduction for extracted declarations should be accessible to all operations. This kind of design should also make testing easier.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Certain refactoring actions (e.g. "Fill-in switch cases") work well together with diagnostic fix-its, as they can be presented in an editor and a user can initiate a refactoring operation using a UI that's already familiar to them. I would like to ensure that this kind of mechanism is accessible to refactoring operations that need it. Our current code contains two actions that are implemented in the<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Edit</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>library. They're usable from<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Sema</span><span style="color: rgb(149, 126, 53);" class="">`</span>, and we take advantage of that to generate the fix-its during semantic analysis.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 19px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">##<span class="Apple-converted-space"> </span></span>Cross-TU Operations & Indexer Queries</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">The majority of refactoring actions that we've implemented perform source transformations in a single translation unit (TU). However, there are some actions that need to work across TU boundaries. Xcode 9 includes one such cross-TU action - “Generate Missing Function Definitions”. A naïve cross-TU solution that I've looked at initially was based on an API that had a series of callbacks between Xcode's indexer and libclang. However, I quickly discovered that this model didn't work that well, as it interfered with the code that loaded and handled different TUs in the indexer.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Note: while "Rename" is a global operation, it doesn't actually interact with other TUs because source replacements can be derived from the data stored in the project's index. Thus, our implementation doesn't treat it as a cross-TU operation.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">The current implementation of the “Generate Missing Function Definitions" action is based on the "refactoring continuations" API. A refactoring continuation is just a suspended refactoring operation that can be executed in a TU that's different to the one in which the operation was created. Each continuation includes TU-specific state that's automatically managed by Clang, as well as a set of questions about that state. Each individual question is called an "indexer query".</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Indexer queries are the core structures that enable cross-TU actions. An external component (like Xcode's indexer) has to evaluate them before running the continuation in order for the operation to work correctly. Each query can be described using four different attributes:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Question: The kind of question that should be answered. Our implementation exposes the following two kinds at the libclang level:<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Decl_FileThatShouldImplement</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">Decl_IsDefined</span><span style="color: rgb(149, 126, 53);" class="">`</span>.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Subject: The TU-specific state from the parent continuation that acts as the question's subject.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Result: The value that has to be set by the external indexer component before running the refactoring continuation.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Action: A flag that represents an additional action that has to be performed by the indexer before running the continuation. We use the<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">RunContinuationInTUThatHasThisFile</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>action in Xcode's indexer to determine which TU should be loaded and used when running the refactoring continuation.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Please note that while I mention "Xcode's indexer" quite a lot in this section, our refactoring continuation API is indexer-agnostic, and is designed to work with any indexer. The indexer just has to implement support for the indexer queries that are required for a particular refactoring operation, and the refactoring engine handles everything else. The code sample below shows how our code constructs the refactoring continuation for the "Generate Missing Function Definitions" action:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">return continueInExternalASTUnit(</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">/*Indexer query that gets annotated with the RunContinuationInTUThatHasThisFile action */ fileThatShouldContainImplementationOf(Container),</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">/*Pointer to the continuation function*/ runInImplementationAST,</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">/*A state value*/ Container,</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">/*An additional indexer query over some state*/ filter(llvm::makeArrayRef(SelectedMethods), [](const DeclEntity &D) { return !D.isDefined(); }));</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">```</div></div></blockquote><div class=""><br class=""></div><div class="">I think the harder design space will be how to run something on "all files containing references to <X>". What we definitely need is an interface that allows the ops to be sharded out across a fleet of machines (we use C++ ;) based on the expected amount of work. This has some restrictions on the design, specifically also is why we use SourceManager independent classes to handle replacements etc.</div></div></div></div></div></blockquote><div><br class=""></div><div>I see. I haven’t thought that much about sharding across machines. However, I do think that we should aim to design structures (for this part of the API in particular) in a manner that can be easily serialized and passed between different processes and machines.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_quote"><div class=""><br class=""></div><div class="">Generally, I fully agree that we can get an interface here that is indexer independent.</div><div class=""> <br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">In practical terms, the following series of events occur in Xcode when it performs the “Generate Missing Function Definitions” operation:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>After the user chooses the "Generate Missing Function Definitions” action, Xcode notifies its indexer that it has to perform that action. The indexer then uses libclang to get the refactoring results after running the action's operation in the initiation TU.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Xcode's indexer sees that the results provide a refactoring continuation instead of source replacements, so it starts looking at the attached indexer queries.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Xcode's indexer evaluates each query by looking at the question's kind and the TU-specific state (A set of<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">CXCursor</span><span style="color: rgb(149, 126, 53);" class="">`</span>s). It sends back the result to libclang using a set of query-agnostic routines that consume different data types.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>After evaluating the queries, Xcode's indexer loads the TU in which the refactoring continuation should run. It knows which TU it has to load by looking at the result of the query that included the<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">RunContinuationInTUThatHasThisFile</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>action flag.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Xcode's indexer then invokes the refactoring continuation in the freshly loaded TU. Clang converts the continuation's state from previously serialized TU-independent state to a state that's specific to the new TU, and continues running the refactoring operation with this state.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Xcode's indexer then receives the source replacements produced by the refactoring operation and passes them back to Xcode so that it can apply the replacements to the source.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I would like to propose an API model that's based on our current "refactoring continuations" API for the cross-TU operations in the new refactoring engine. Clang will provide a C++ API that can be used in a way that's similar to the code presented above. It will also manage all of the interactions with libclang and Clangd, so individual refactoring operations won't have to worry about the fine details of a particular indexer. Furthermore, the new refactoring engine will limit the set of available actions based on the set of queries that are supported by an indexer, so the indexer that chooses to support refactoring continuations won't have to support all of the queries.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 19px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">##<span class="Apple-converted-space"> </span></span>Testing & Tooling</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">The<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>tool will be used to test the refactoring engine. I would like to propose the following action-agnostic command line interface:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class="">clang-refactor <action> [options] <initiation file> [additional build options]</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">```</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I think that the tool should use comment-based annotations in the test source files to control things like initiation. For example, given a selection annotation<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">// selection: +1:1 -> +2:12</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>on line 12,<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>will map it to a selection range of 13:1 -> 14:12 and will initiate a certain refactoring action using that selection.</div></div></blockquote><div class=""><br class=""></div><div class="">Ok, already bikeshedding: can we call it a range instead of a selection? </div></div></div></div></div></blockquote><div><br class=""></div><div>Sure. The keyword is not what's important though ;)</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">In addition to<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span>, I would also like to provide an additional stress-test tool that will work with entire projects (using compilation databases), and will be capable of:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Initiating/performing refactoring actions at each token in all of the source files in a project.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Verifying the consistency between the indexer and the refactoring engine to ensure that they have the same model of the source.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">This tool will also come with a script that generates compilation databases for Clang's tests.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">I also have a great little reviewing tool that helps others to visualize the refactoring changes for a particular action, and I'd be more than happy to share it if you're interested. The tool generates a set of HTML pages that contain the sources of the refactoring tests. The pages get annotated to show the changes that were made during refactoring. We found that looking at this visualization instead of the raw<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">CHECK</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>lines makes reviewers' life much easier.</div></div></blockquote><div class=""><br class=""></div><div class="">Nice! Additionally, I'd also suggest to use unit tests, especially for small dedicated regression tests where the AST is complex (might be more of a problem for C++).</div></div></div></div></div></blockquote><div><br class=""></div><div>I generally agree, I think that our code relied on end-to-end regression tests too much. Some self-contained components will be tested with unit tests instead in the new engine.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 25px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">#<span class="Apple-converted-space"> </span></span>Action Plan</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Initially I would like to adopt the following high-level plan for the creation of the new refactoring engine:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Upstream any non-refactoring specific changes from our code.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Move the core of<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-rename</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>over to clang (<span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-rename</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>should still work as before).</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Start working on the<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>tool so that it can use the previously moved code. Move the tests from<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-rename</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>over to Clang and convert them to<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-refactor</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>tests.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Submit our changes to the core of the<span class="Apple-converted-space"> </span><span style="color: rgb(149, 126, 53);" class="">`</span><span style="font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">clang-rename</span><span style="color: rgb(149, 126, 53);" class="">`</span><span class="Apple-converted-space"> </span>engine.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Create and test the new global rename component.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Create an AST source selection component. Initiation via source selection will be based on this component.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Create a refactoring initiation API that will be easy to use.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Start submitting our local refactoring actions.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Start working on the libclang API.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">-</span><span class="Apple-converted-space"> </span>Create and submit everything else that remains, e.g. Cross-TU Operations & Indexer Queries.</div></div></blockquote><div class=""><br class=""></div><div class="">Sounds generally good. Thanks!</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Cheers,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; background-color: rgb(255, 255, 255);" class="">Alex</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(19, 55, 255); background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">[</span><span style="" class="">1</span><span style="color: rgb(149, 126, 53);" class="">]:</span><span style="" class=""><span class="Apple-converted-space"> </span></span><a href="http://lists.llvm.org/pipermail/cfe-dev/2017-June/054108.html" target="_blank" class="">http://lists.llvm.org/pipermail/cfe-dev/2017-June/054108.html</a></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(19, 55, 255); background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">[</span><span style="" class="">2</span><span style="color: rgb(149, 126, 53);" class="">]:</span><span style="" class=""><span class="Apple-converted-space"> </span></span><a href="https://github.com/apple/swift-clang/commit/9890adfbee8f854732d0093bc8b2a32be1be8844" target="_blank" class="">https://github.com/apple/swift-clang/commit/9890adfbee8f854732d0093bc8b2a32be1be8844</a></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(19, 55, 255); background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(149, 126, 53);" class="">[</span><span style="" class="">3</span><span style="color: rgb(149, 126, 53);" class="">]:</span><span style="" class=""><span class="Apple-converted-space"> </span></span><a href="http://lists.llvm.org/pipermail/cfe-dev/2017-May/053869.html" target="_blank" class="">http://lists.llvm.org/pipermail/cfe-dev/2017-May/053869.html</a></div><br class="Apple-interchange-newline"></div></blockquote></div></div></div></div></blockquote></div><br class=""></body></html>