You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test go_to_definition_for_structs tests the "go to definition" handler in this file:
contract;
/// My data enum
enum Data {
First: (),
Second: (),
}
/// My struct type
struct MyStruct<T, U> {
g: U,
x: T,
y: Data,
z: (u64, Data),
t: [Data; 5],
j: (u32, (Data, [Data; 2])),
o: Option<Identity>,
}
The request points to "U" of "g: U", and expects the response point to "U" of "struct MyStruct<T, U>". Which works currently; but if an impl item appears after the struct declaration such as
contract;
/// My data enum
enum Data { ... }
/// My struct type
struct MyStruct<T, U> { ... }
trait A {}
impl<T, U> A for MyStruct<T, U> {}
Now, the same "go to definition" request points to the second "U" of the new line "impl<T, U> A for MyStruct<T, U> {}", which is wrong.
The text was updated successfully, but these errors were encountered:
Am Kevin Momanyi Web3 developer in smart contract development, decentralized applications, and blockchain security. I have skills in Cairo, and Starknet, with a deep understanding of ZK-rollups and on-chain game mechanics. Am thriving in building scalable, secure, and efficient blockchain solutions, leveraging technologies like Starknet.js, Dojo, and Rust for cutting-edge development. My background in security research gives me a strong edge in writing secure and optimized smart contracts, ensuring reliability and efficiency in Web3 ecosystems.
I have read and understood what the sway project is all about looking forward to contribute in the required time framework. Your effort to assign me the issues will be highly appreciated, thanks.
I came across the issue regarding the incorrect "go to definition" behavior when an impl item follows a struct declaration. As a Web3 developer with experience in Rust and blockchain tooling, I have worked extensively with LSPs, compilers, and improving developer workflows.
I understand that the current issue arises due to the request incorrectly resolving to the U in impl<T, U> A for MyStruct<T, U> {} instead of the U in struct MyStruct<T, U>. I would love to investigate and contribute a fix to ensure proper reference resolution.
Looking forward to your guidance on where I can begin. Let me know if i can be assigned this issue .
The test
go_to_definition_for_structs
tests the "go to definition" handler in this file:The request points to "U" of "g: U", and expects the response point to "U" of "struct MyStruct<T, U>". Which works currently; but if an
impl
item appears after the struct declaration such asNow, the same "go to definition" request points to the second "U" of the new line "impl<T, U> A for MyStruct<T, U> {}", which is wrong.
The text was updated successfully, but these errors were encountered: