<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 24, 2015, at 10:12 , Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">On 24 Jun 2015 10:00 am, "Jordan Rose" <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:<br class="">
><br class="">
><br class="">
>> On Jun 23, 2015, at 14:15 , Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:<br class="">
>><br class="">
>> On Tue, Jun 23, 2015 at 10:53 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:<br class="">
>>><br class="">
>>> Hi, Richard. Thanks for all your improvements to modules this year! I just filed PR23929, which shows how code completion is no longer finding macros that come from modules. Any idea what should be changed here? If you don't have time to fix this I'm happy to be the one who actually codes it up, but at the moment I'm not even quite sure what piece is missing.<br class="">
>><br class="">
>><br class="">
>> Identifiers that have macro names imported from modules get lazily updated, and macro_begin isn't triggering enough updating to produce a complete map. The easiest thing to do would be to walk the ModuleMacros map from within macro_begin, and add entries for each identifier with any module macros to the MacroMap in the CurSubmoduleState. (Alternatively, you could change macro_begin/macro_end to return iterators over the identifier table that filter out non-macro identifiers. Either way is a little wasteful, but avoiding that waste would require implementing a rather fancy iterator, which seems like overkill for this problem.)<br class="">
>><br class="">
>> I think this should be a straightforward fix; if you have problems, let me know and I'll tackle it. Sorry for breaking you :-)<br class="">
><br class="">
><br class="">
> Ah, you're right, it was that simple. How does the attached patch look? Do you think I need to beef up the tests to account for visible vs. non-visible modules, or do you think this is fine to commit as is?</p><p dir="ltr" class="">LGTM</p><p dir="ltr" class="">(I think we already have test coverage for macro name visibility in code completion.)</p></div></blockquote></div><div>Sounds good. Committed as r240571. Thanks for the help!</div><div><br class=""></div><div>Jordan</div><br class=""></body></html>