Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3f664a2

Browse files
remove stuff
1 parent 24aee5a commit 3f664a2

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

‎crates/pgt_hover/src/contextual_priority.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ impl ContextualPriority for Table {
4848
fn relevance_score(&self, ctx: &TreesitterContext) -> f32 {
4949
let mut score = 0.0;
5050

51-
// Highest priority: table explicitly mentioned in the query
5251
for (schema_opt, tables) in &ctx.mentioned_relations {
5352
if tables.contains(&self.name) {
54-
// Extra points if schema also matches
5553
if schema_opt.as_deref() == Some(&self.schema) {
5654
score += 200.0;
5755
} else {
@@ -60,16 +58,6 @@ impl ContextualPriority for Table {
6058
}
6159
}
6260

63-
// Check if table is mentioned via alias
64-
if ctx
65-
.mentioned_table_aliases
66-
.values()
67-
.any(|table_name| *table_name == self.name)
68-
{
69-
score += 140.0;
70-
}
71-
72-
// Medium priority: same schema as mentioned tables
7361
if ctx
7462
.mentioned_relations
7563
.keys()
@@ -78,8 +66,7 @@ impl ContextualPriority for Table {
7866
score += 50.0;
7967
}
8068

81-
// Lower priority: public schema
82-
if self.schema == "public" {
69+
if self.schema == "public" && score == 0.0 {
8370
score += 10.0;
8471
}
8572

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /