|
| 1 | +use pgt_schema_cache::SchemaCache; |
| 2 | + |
1 | 3 | use crate::{contextual_priority::ContextualPriority, to_markdown::ToHoverMarkdown}; |
2 | 4 |
|
3 | 5 | mod column; |
@@ -70,36 +72,36 @@ impl ContextualPriority for Hoverable<'_> { |
70 | 72 | } |
71 | 73 |
|
72 | 74 | impl ToHoverMarkdown for Hoverable<'_> { |
73 | | - fn hover_headline<W: std::fmt::Write>(&self, writer: &mut W) -> Result<(), std::fmt::Error> { |
| 75 | + fn hover_headline<W: std::fmt::Write>(&self, writer: &mut W, schema_cache: &SchemaCache) -> Result<(), std::fmt::Error> { |
74 | 76 | match self { |
75 | | - Hoverable::Table(table) => ToHoverMarkdown::hover_headline(*table, writer), |
76 | | - Hoverable::Column(column) => ToHoverMarkdown::hover_headline(*column, writer), |
77 | | - Hoverable::Function(function) => ToHoverMarkdown::hover_headline(*function, writer), |
78 | | - Hoverable::Role(role) => ToHoverMarkdown::hover_headline(*role, writer), |
79 | | - Hoverable::Schema(schema) => ToHoverMarkdown::hover_headline(*schema, writer), |
80 | | - Hoverable::PostgresType(type_) => ToHoverMarkdown::hover_headline(*type_, writer), |
| 77 | + Hoverable::Table(table) => ToHoverMarkdown::hover_headline(*table, writer, schema_cache), |
| 78 | + Hoverable::Column(column) => ToHoverMarkdown::hover_headline(*column, writer, schema_cache), |
| 79 | + Hoverable::Function(function) => ToHoverMarkdown::hover_headline(*function, writer, schema_cache), |
| 80 | + Hoverable::Role(role) => ToHoverMarkdown::hover_headline(*role, writer, schema_cache), |
| 81 | + Hoverable::Schema(schema) => ToHoverMarkdown::hover_headline(*schema, writer, schema_cache), |
| 82 | + Hoverable::PostgresType(type_) => ToHoverMarkdown::hover_headline(*type_, writer, schema_cache), |
81 | 83 | } |
82 | 84 | } |
83 | 85 |
|
84 | | - fn hover_body<W: std::fmt::Write>(&self, writer: &mut W) -> Result<bool, std::fmt::Error> { |
| 86 | + fn hover_body<W: std::fmt::Write>(&self, writer: &mut W, schema_cache: &SchemaCache) -> Result<bool, std::fmt::Error> { |
85 | 87 | match self { |
86 | | - Hoverable::Table(table) => ToHoverMarkdown::hover_body(*table, writer), |
87 | | - Hoverable::Column(column) => ToHoverMarkdown::hover_body(*column, writer), |
88 | | - Hoverable::Function(function) => ToHoverMarkdown::hover_body(*function, writer), |
89 | | - Hoverable::Role(role) => ToHoverMarkdown::hover_body(*role, writer), |
90 | | - Hoverable::Schema(schema) => ToHoverMarkdown::hover_body(*schema, writer), |
91 | | - Hoverable::PostgresType(type_) => ToHoverMarkdown::hover_body(*type_, writer), |
| 88 | + Hoverable::Table(table) => ToHoverMarkdown::hover_body(*table, writer, schema_cache), |
| 89 | + Hoverable::Column(column) => ToHoverMarkdown::hover_body(*column, writer, schema_cache), |
| 90 | + Hoverable::Function(function) => ToHoverMarkdown::hover_body(*function, writer, schema_cache), |
| 91 | + Hoverable::Role(role) => ToHoverMarkdown::hover_body(*role, writer, schema_cache), |
| 92 | + Hoverable::Schema(schema) => ToHoverMarkdown::hover_body(*schema, writer, schema_cache), |
| 93 | + Hoverable::PostgresType(type_) => ToHoverMarkdown::hover_body(*type_, writer, schema_cache), |
92 | 94 | } |
93 | 95 | } |
94 | 96 |
|
95 | | - fn hover_footer<W: std::fmt::Write>(&self, writer: &mut W) -> Result<bool, std::fmt::Error> { |
| 97 | + fn hover_footer<W: std::fmt::Write>(&self, writer: &mut W, schema_cache: &SchemaCache) -> Result<bool, std::fmt::Error> { |
96 | 98 | match self { |
97 | | - Hoverable::Table(table) => ToHoverMarkdown::hover_footer(*table, writer), |
98 | | - Hoverable::Column(column) => ToHoverMarkdown::hover_footer(*column, writer), |
99 | | - Hoverable::Function(function) => ToHoverMarkdown::hover_footer(*function, writer), |
100 | | - Hoverable::Role(role) => ToHoverMarkdown::hover_footer(*role, writer), |
101 | | - Hoverable::Schema(schema) => ToHoverMarkdown::hover_footer(*schema, writer), |
102 | | - Hoverable::PostgresType(type_) => ToHoverMarkdown::hover_footer(*type_, writer), |
| 99 | + Hoverable::Table(table) => ToHoverMarkdown::hover_footer(*table, writer, schema_cache), |
| 100 | + Hoverable::Column(column) => ToHoverMarkdown::hover_footer(*column, writer, schema_cache), |
| 101 | + Hoverable::Function(function) => ToHoverMarkdown::hover_footer(*function, writer, schema_cache), |
| 102 | + Hoverable::Role(role) => ToHoverMarkdown::hover_footer(*role, writer, schema_cache), |
| 103 | + Hoverable::Schema(schema) => ToHoverMarkdown::hover_footer(*schema, writer, schema_cache), |
| 104 | + Hoverable::PostgresType(type_) => ToHoverMarkdown::hover_footer(*type_, writer, schema_cache), |
103 | 105 | } |
104 | 106 | } |
105 | 107 |
|
|
0 commit comments