I am just trying out Diesel and am pretty new to Rust. I am noticing when going through the tutorials that the IDE experience (Visual Studio Code in my case) is not providing much assistance (intellisense, navigating to meaningful code) with respect to the code generated by the macros in the models.rs and schema.rs files.
It is my guess that the reason for this is that the Rust Language Server (RLS) is not able to provide the information necessary for intellisense from the code generated by macros. Is this the case?
If so, might a future version of diesel benefit from generating “non touchable” source code rather than the compact “macro expanded” file schema.rs so that a user of the library benefits from both intellisense and the ability to inspect the generated source code to understand what is happening under the hood?
Taking this concept to its ultimate endpoint, might a future version start with a database agnostic schema definition file stored with each migration, use that to create the initial up.sql and down.sql files (that would need to be modifiable), and then generate all source code in a set of files not to be edited by the developer as they would be regenerated when the database agnostic schema definition has changed.
Would this make sense?
Or is there something about “The Rust way” I might be missing?