Skip to content

Commit 2133bda

Browse files
committed
progress
1 parent 9842753 commit 2133bda

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

crates/pgls_workspace/src/workspace/server.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl Workspace for WorkspaceServer {
358358
None => Some("Statement execution not allowed against database.".into()),
359359
};
360360

361-
let actions = parser
361+
let mut actions: Vec<CodeAction> = parser
362362
.iter_with_filter(
363363
DefaultMapper,
364364
CursorPositionFilter::new(params.cursor_position),
@@ -379,6 +379,21 @@ impl Workspace for WorkspaceServer {
379379
})
380380
.collect();
381381

382+
// Add reload schema cache action
383+
let reload_disabled_reason = if self.get_current_connection().is_some() {
384+
None
385+
} else {
386+
Some("No database connection available.".into())
387+
};
388+
389+
actions.push(CodeAction {
390+
title: "Reload Schema Cache".into(),
391+
kind: CodeActionKind::Command(CommandAction {
392+
category: CommandActionCategory::InvalidateSchemaCache,
393+
}),
394+
disabled_reason: reload_disabled_reason,
395+
});
396+
382397
Ok(CodeActionsResult { actions })
383398
}
384399

0 commit comments

Comments
 (0)