Skip to content

Go-to-definition for a class returns both the __init__ definition and the class itself #2218

@lkhphuc

Description

@lkhphuc

Summary

When using the "go to definition" (in neovim) for a class, currently ty return 2 "definitions":

  • The class name line class MyClass(...):
  • and the init method def __init__(self,...):

I'm not sure if this is by design or not, but other lsp (pyright) just return one definition class MyClass and thus the editor can jump directly to that definition.
Current it unnecessary open a picker to pick the definition even though there's just one implementaton of that class.

Image

Version

ty 0.0.5

Metadata

Metadata

Assignees

Labels

serverRelated to the LSP server

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions