Update: Solana Rust Analyzer supports latest version with Proc Macro support
The Solana community is constantly looking for ways to improve the development experience, and recently the Rust analyzer extension for VSCode has undergone a major update. The latest version, 0.3.220 or later, removed support for proc macro versions <2, which are important dependencies in many Solana projects.
Proc macros allow developers to extend the functionality of their code at compile time, making it easier to write efficient and maintainable code. However, they require special compiler features that were not available in older versions of Rust, such as <2.
As announced on December 16, 2024, the new version of the Solana Rust Analyzer Extension has dropped support for Proc Macro versions <2. This means that users who rely on Solana 1.18.17 or earlier in their projects may encounter issues when trying to compile with the latest analyzer.
What this means for developers
To avoid compatibility issues, it is recommended to update your project dependencies to version ≥ 0.3.220 or later. This update includes several important changes that improve performance and stability:
- Improved support for new Rust features
: The new analyzer now correctly uses the
proc_macrofeature in Solana 1.18.17, allowing for better integration with proc macros.
- Better error messages: The updated analyzer provides more informative error messages to help developers diagnose issues.
- New test cases: The developer has added new test cases to ensure that the analyzer handles different scenarios correctly.
Upgrading your project
<img alt="Solana: Proc-macro (
If you are using Solana 1.18.17 or earlier, you should upgrade your project to version ≥ 0.3.220 or later. To do this, follow these steps:
- Install the latest version of the VSCode Rust Analyzer plugin [from the official repository](
- Update the cargo.toml file to ensure it is compatible with the new analyzer.
- Run a “cargo build” and then check for any errors or warnings.
By following these steps, you will be able to benefit from the latest features and improvements in Solana Rust Analysis. Happy coding!