Stream: t-compiler/wg-rls-2.0

Topic: Generate syntax item


ice1000 (Dec 03 2019 at 04:20, on Zulip):

I'm trying to look into https://github.com/rust-analyzer/rust-analyzer/issues/1165, and I'm trying to add ModuleItem to Blocks. I've changed the grammar.ron, but where should I actually put the parsed things into the AST?

ice1000 (Dec 03 2019 at 04:23, on Zulip):

Oh, is RA parsing things by trying to cast them? Then it looks like the items are naturally collected

matklad (Dec 03 2019 at 07:27, on Zulip):

@ice1000 be warned that #1165 is a rather involved issue, which requires a bit of up-front design.

I don't think it requires any changes on the parser level though... Rather, it probably needs:

ice1000 (Dec 03 2019 at 15:18, on Zulip):

Yes, but the grammar.ron needs to be changed

ice1000 (Dec 03 2019 at 15:18, on Zulip):

Yes, but the grammar.ron needs to be changed

matklad (Dec 03 2019 at 15:20, on Zulip):

Oh, you are of course right, @ice1000 ! Yeah, I think we should add ModuleItemOwner to the list of traits that is implemented by ast::Block.

ice1000 (Dec 03 2019 at 15:24, on Zulip):

My WIP branch is https://github.com/ice1000/rust-analyzer/tree/oxa-very-cute

ice1000 (Dec 03 2019 at 15:24, on Zulip):

I'm not sure if I'm on the right direction

Last update: Dec 12 2019 at 00:45UTC