Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go To Implementation #6

Open
Tracked by #1
z80dev opened this issue Sep 18, 2023 · 0 comments
Open
Tracked by #1

Go To Implementation #6

z80dev opened this issue Sep 18, 2023 · 0 comments

Comments

@z80dev
Copy link
Collaborator

z80dev commented Sep 18, 2023

For a given interface, we want to be able to jump to the implementation of required functions.

Because this works at the function level and not at the interface level, this will not be supported for imported interfaces, but only for interfaces declared within the contract being worked on.

LSP API Methods

  • textDocument/implementation

Example

Functions

owner: address

interface Ownable:
    # get address of owner
    def owner() -> address: view

implements: Ownable

@view
@external
def owner() -> address:
    return self.owner

Running go to implementation with the cursor on the owner line within the Ownable interface should jump the cursor to the implementation of owner() at the end of the contract.

Public Variables

owner: public(address)

interface Ownable:
    # get address of owner
    def owner() -> address: view

implements: Ownable

In this case, there is no explicit owner() function. Instead, a public variable is declared, which automatically creates this function. In this case, the cursor should jump to where the public variable is declared at the top of the contract.

@z80dev z80dev mentioned this issue Sep 18, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant