@@ -67,6 +67,7 @@ pub fn hover(file: &ast::SourceFile, offset: TextSize) -> Option<String> {
6767 return hover_column ( file, & name_ref, & binder) ;
6868 }
6969 NameRefClass :: DropSequence => return hover_sequence ( file, & name_ref, & binder) ,
70+ NameRefClass :: Tablespace => return hover_tablespace ( file, & name_ref, & binder) ,
7071 NameRefClass :: DropIndex => return hover_index ( file, & name_ref, & binder) ,
7172 NameRefClass :: DropFunction => return hover_function ( file, & name_ref, & binder) ,
7273 NameRefClass :: DropAggregate => return hover_aggregate ( file, & name_ref, & binder) ,
@@ -107,6 +108,9 @@ pub fn hover(file: &ast::SourceFile, offset: TextSize) -> Option<String> {
107108 NameClass :: CreateSequence ( create_sequence) => {
108109 return format_create_sequence ( & create_sequence, & binder) ;
109110 }
111+ NameClass :: CreateTablespace ( create_tablespace) => {
112+ return format_create_tablespace ( & create_tablespace) ;
113+ }
110114 NameClass :: CreateType ( create_type) => {
111115 return format_create_type ( & create_type, & binder) ;
112116 }
@@ -322,6 +326,17 @@ fn hover_sequence(
322326 format_create_sequence ( & create_sequence, binder)
323327}
324328
329+ fn hover_tablespace (
330+ file : & ast:: SourceFile ,
331+ name_ref : & ast:: NameRef ,
332+ binder : & binder:: Binder ,
333+ ) -> Option < String > {
334+ let tablespace_ptr = resolve:: resolve_name_ref ( binder, name_ref) ?;
335+ let root = file. syntax ( ) ;
336+ let tablespace_name_node = tablespace_ptr. to_node ( root) ;
337+ Some ( format ! ( "tablespace {}" , tablespace_name_node. text( ) ) )
338+ }
339+
325340fn hover_type (
326341 file : & ast:: SourceFile ,
327342 name_ref : & ast:: NameRef ,
@@ -474,6 +489,11 @@ fn format_create_sequence(
474489 Some ( format ! ( "sequence {}.{}" , schema, sequence_name) )
475490}
476491
492+ fn format_create_tablespace ( create_tablespace : & ast:: CreateTablespace ) -> Option < String > {
493+ let name = create_tablespace. name ( ) ?. syntax ( ) . text ( ) . to_string ( ) ;
494+ Some ( format ! ( "tablespace {}" , name) )
495+ }
496+
477497fn index_schema ( create_index : & ast:: CreateIndex , binder : & binder:: Binder ) -> Option < String > {
478498 let position = create_index. syntax ( ) . text_range ( ) . start ( ) ;
479499 let search_path = binder. search_path_at ( position) ;
0 commit comments