Open
Description
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
- Start returning the table name from our middleware
- During the
activate
call parseschema.rb
and create a hash of table names to locations - 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