-
Notifications
You must be signed in to change notification settings - Fork 68
Support for Rust #16
Comments
How do you manage to represent lifetimes or variable shadowing in Sourcetrail? |
@cata0309 We don't.
|
In Rust lang you can do something like this
How would you represent the variable |
As mentioned, you can append info to the name of the |
Do you think it is possible to use the Rust language server for this work? That might make it possible to map all languages that have such a server (e.g. Go, TypeScript, etc) in a generic way into Sourcetrail |
@jokeyrhyme I was just wondering the same thing, because a well-implemented Language Server can handle most (maybe all?) of what Sourcetrail needs. I'll create a separate issue. EDIT: Added as #20 |
how is the project progressing? I've been waiting for a ~year. I really need rust language support. please do not abandon the project. |
@D1mon I am sorry to inform you but it looks like a dead end, things are moving slow. |
Hello !
I've started the work concerning the rust bindings of SourcetrailDB. It is a (very) early (and non yet working) version of those, made with rust-bindgen.
You can see the progress and contribute at https://github.com/Champii/SourcetrailDB/tree/master/resources_rust
The current approach is to use rust-bindgen directly on the generated static library, but that may be inefficient as rust-bindgen does not handle std types well (std::string for example). Their doc recommend to generate them all as opaque types, but then we lose the ability to use them.
One of the possible workaround is to create a C ABI to interface the C++ code with Rust, or to try the method used by the python bindings and wrap the most commonly used features in a lightweight and thus Rust-friendly C++ library.
I'll try them both and consider the one that fit the most.
Feel free to share your point of view on the matter, and/or throw some suggestions on the best way to handle that !
If I can be of any help, I'd be glad to :)
The text was updated successfully, but these errors were encountered: