starkware-libs / cairo

Cairo is the first Turing-complete language for creating provable programs for general computation.
Apache License 2.0
1.52k stars 469 forks source link

Provide intention to fill trait members #5944

Open mkaput opened 2 months ago

mkaput commented 2 months ago

Implement the following intention in CairoLS:

Image

LamsyA commented 1 month ago

hello @mkaput Kindly provide the link to this in the codebase.

mkaput commented 1 month ago

Hey! Same store as in #5945

Here's the starting point: https://github.com/starkware-libs/cairo/blob/cdaceb909ccf0644b7e385669d2c48417ceb90d4/crates/cairo-lang-language-server/src/ide/code_actions/mod.rs#L34-L78

You can follow the implementation of unused variable intention as the hooking point. First, you need to assign an error code to this particular diagnostic; you can grep for it by error message.

You will need to get information about trait items. This is provided in the SemanticGroup (this trait-Salsa group is implemented by AnalysisDatabase) by these queries: https://github.com/starkware-libs/cairo/blob/50d465cd4facb6742f72d3d43f87378ebd92e13f/crates/cairo-lang-semantic/src/db.rs#L397-L431

mkaput commented 1 month ago

@LamsyA any progress? how can I help?