cairo icon indicating copy to clipboard operation
cairo copied to clipboard

Hovers on identifiers *defining* the item/variable are not working

Open mkaput opened this issue 1 year ago • 5 comments
trafficstars

Summary

When hovering over identifiers which define items/variables, user expects to get the same hover information as one produced when hovering over identifiers which reference these elements.

See examples:

Expected Actual
Image Image This case shows no hovers at all.
Image Image This is the legacy hover implementation that we aim to remove.

Proposed solution

This logic only looks for references and completely ignores cases when the identifier under the cursor is actual name of the item/variable. Such condition should be added to this code:

https://github.com/starkware-libs/cairo/blob/4646ad819521338ccd92b8ebef76b96770b46ce1/crates/cairo-lang-language-server/src/lang/inspect/defs.rs#L40-L46

mkaput avatar Jun 19 '24 10:06 mkaput