Description
Our parser currently assumes the latest edition (+ a small hack to be able to parse the standard libraries try macro, although that's not really useful anymore). We should fix this!
This is gonna be 2 main tasks:
- Making the parser edition aware (and have rust-analyzer just pass the latest edition to it).
- Make rust-analyzer ask for file parses with the corresponding editions
The first point should be fairly trivial I believe, it's just adding an edition field to the Parser
struct and then some special branching and recognizing certain keywords based on edition etc.
The second one is going to be more tricky, as for one, anywhere where we execute the parse query we will have to now supply an edition, similarly we have to do this for whenever we parse a macro expansion. The edition for a normal file parse is gonna be decided by the crate's edition the file belongs to, the edition for a macro parse on the other hand depends on the edition of the crate that the macro definition belongs to (I think).
So with that said, the first point is a rather simple change, the second will be more invasive.