-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Long term goal] Replace rustc-ap-syntax crates with rust-analyzer #3932
Comments
In your experimentation have you found the build process to be noticeably quicker with Also, I'd be curious how testable the code would be at the unit-test level with |
I have not fully replaced Concerning testability, yes, I think that switching to |
It looks like folks are trying to unify the codebase of the rustc's frontend and rust-analyzer: rust-lang/rfcs#2912. They haven't reached a conclusion on to what extent the code should be shared among those two, though we could dream for a stable-parsing library for the rust programming language. |
rustfmt relies on
rustc-ap-syntax
and its friends, which are a direct port of the rustc parser, to parse files and construct AST. This strategy has both pros and cons:rustc-ap-*
crates consume a lot of timeAll things considered, I have been looking for alternatives that would replace rustc-ap-*s.
I have been experimenting with rust-analyzer, and so far, it seems reasonable - it can parse a file, offers the span-ish feature, and panic-free. It does not recursively parse modules though we won't need to do so once #3930 gets resolved. We need more investigation, but overall, I believe rustfmt can replace its frontend with rust-analyzer's parser without any breakages.
Some concerns I am aware of:
The text was updated successfully, but these errors were encountered: