Skip to content

Commit 23216d1

Browse files
authored
Ensure schema link is rendered with column information (#475)
1 parent c5043be commit 23216d1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/ruby_lsp/ruby_lsp_rails/hover.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def generate_column_content(name)
6262
schema_file = model[:schema_file]
6363

6464
@response_builder.push(
65-
"[Schema](#{URI::Generic.from_path(path: schema_file)})",
66-
category: :links,
65+
"[Schema](#{URI::Generic.from_path(path: schema_file)})\n",
66+
category: :documentation,
6767
) if schema_file
6868

6969
@response_builder.push(

test/ruby_lsp_rails/hover_test.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ class User < ApplicationRecord
3535
```
3636
3737
**Definitions**: [fake.rb](file:///fake.rb#L1,1-2,4)
38-
[Schema](#{URI::Generic.from_path(path: dummy_root + "/db/schema.rb")})
3938
4039
40+
[Schema](#{URI::Generic.from_path(path: dummy_root + "/db/schema.rb")})
41+
4142
**id**: integer (PK)
4243
4344
**first_name**: string
@@ -83,9 +84,10 @@ class User < ApplicationRecord
8384
```
8485
8586
**Definitions**: [fake.rb](file:///fake.rb#L2,3-3,6)
86-
[Schema](#{URI::Generic.from_path(path: dummy_root + "/db/schema.rb")})
8787
8888
89+
[Schema](#{URI::Generic.from_path(path: dummy_root + "/db/schema.rb")})
90+
8991
**id**: integer (PK)
9092
9193
**first_name**: string
@@ -128,9 +130,10 @@ class CompositePrimaryKey < ApplicationRecord
128130
```
129131
130132
**Definitions**: [fake.rb](file:///fake.rb#L1,1-2,4)
131-
[Schema](#{URI::Generic.from_path(path: dummy_root + "/db/schema.rb")})
132133
133134
135+
[Schema](#{URI::Generic.from_path(path: dummy_root + "/db/schema.rb")})
136+
134137
**order_id**: integer (PK)
135138
136139
**product_id**: integer (PK)

0 commit comments

Comments
 (0)