Skip to content

Enhance our schema hover link to jump to the right table #52

Open
@vinistock

Description

@vinistock

Currently, our schema link just points to the file. However, we can link to the specific table for the model, which is a richer experience.

One possibility of how we can do this is by

  1. Start returning the table name from our middleware
  2. During the activate call parse schema.rb and create a hash of table names to locations
  3. When executing hover, search the hash for the right line to jump to

Concerns

  • If there are modifications in schema.rb, we would need to rebuild the hash. For that, we need file watching to be merged in the Ruby LSP and then we have to design a way in which extensions can ask the Ruby LSP to notify them when certain files are changed.
  • This won't work for structure.sql. We probably don't want a SQL parser, but we might be able to achieve something with regexes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions