File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
crates/pgls_workspace/src/workspace Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments