Shopify / ruby-lsp-rails

A Ruby LSP addon for Rails
https://shopify.github.io/ruby-lsp-rails/
MIT License
518 stars 21 forks source link

Add primary key indicator to model hover response #316

Closed Earlopain closed 2 months ago

Earlopain commented 3 months ago

Closes #313

Rails 7.1 supports composite primary keys so the return type will either be a string or an array of strings, depending on the pk type. I've added a test for that case.

I was a bit surprised that the tests don't go through resolve_database_info_from_model. I guess because it would involve the runner and require db setup? Anyways, I tested it manually and this is what it looks like: image image

andyw8 commented 3 months ago

I was a bit surprised that the tests don't go through resolve_database_info_from_model.

You're right, we've been meaning to re-work this: https://github.com/Shopify/ruby-lsp-rails/issues/317