@@ -300,6 +300,149 @@ async fn test_role_hover_alter_role(test_db: PgPool) {
300300}
301301
302302#[ sqlx:: test( migrator = "pgt_test_utils::MIGRATIONS" ) ]
303+ async fn test_table_hover_with_quoted_schema ( test_db : PgPool ) {
304+ let setup = r#"
305+ create schema auth;
306+ create table auth.users (
307+ id serial primary key,
308+ email varchar(255) not null
309+ );
310+ "# ;
311+
312+ let query = format ! (
313+ r#"select * from "auth".use{}rs"# ,
314+ QueryWithCursorPosition :: cursor_marker( )
315+ ) ;
316+
317+ test_hover_at_cursor ( "table_hover_quoted_schema" , query, Some ( setup) , & test_db) . await ;
318+ }
319+
320+ #[ sqlx:: test( migrator = "pgt_test_utils::MIGRATIONS" ) ]
321+ async fn test_function_hover_with_quoted_schema ( test_db : PgPool ) {
322+ let setup = r#"
323+ create schema auth;
324+ create or replace function auth.authenticate_user(user_email text)
325+ returns boolean
326+ language plpgsql
327+ security definer
328+ as $$
329+ begin
330+ return exists(select 1 from auth.users where email = user_email);
331+ end;
332+ $$;
333+ "# ;
334+
335+ let query = format ! (
336+ r#"select "auth".authenticate_u{}ser('test@example.com')"# ,
337+ QueryWithCursorPosition :: cursor_marker( )
338+ ) ;
339+
340+ test_hover_at_cursor ( "function_hover_quoted_schema" , query, Some ( setup) , & test_db) . await ;
341+ }
342+
343+ #[ sqlx:: test( migrator = "pgt_test_utils::MIGRATIONS" ) ]
344+ async fn test_column_hover_with_quoted_schema_table ( test_db : PgPool ) {
345+ let setup = r#"
346+ create schema auth;
347+ create table auth.user_profiles (
348+ id serial primary key,
349+ user_id int not null,
350+ first_name varchar(100),
351+ last_name varchar(100)
352+ );
353+ "# ;
354+
355+ let query = format ! (
356+ r#"select "auth"."user_profiles".first_n{}ame from "auth"."user_profiles""# ,
357+ QueryWithCursorPosition :: cursor_marker( )
358+ ) ;
359+
360+ test_hover_at_cursor (
361+ "column_hover_quoted_schema_table" ,
362+ query,
363+ Some ( setup) ,
364+ & test_db,
365+ )
366+ . await ;
367+ }
368+
369+ #[ sqlx:: test( migrator = "pgt_test_utils::MIGRATIONS" ) ]
370+ async fn test_table_hover_with_quoted_table_name ( test_db : PgPool ) {
371+ let setup = r#"
372+ create schema auth;
373+ create table auth.users (
374+ id serial primary key,
375+ email varchar(255) not null
376+ );
377+ "# ;
378+
379+ let query = format ! (
380+ r#"select * from "auth"."use{}rs""# ,
381+ QueryWithCursorPosition :: cursor_marker( )
382+ ) ;
383+
384+ test_hover_at_cursor (
385+ "table_hover_quoted_table_name" ,
386+ query,
387+ Some ( setup) ,
388+ & test_db,
389+ )
390+ . await ;
391+ }
392+
393+ #[ sqlx:: test( migrator = "pgt_test_utils::MIGRATIONS" ) ]
394+ async fn test_column_hover_with_quoted_column_name ( test_db : PgPool ) {
395+ let setup = r#"
396+ create schema auth;
397+ create table auth.users (
398+ id serial primary key,
399+ email varchar(255) not null
400+ );
401+ "# ;
402+
403+ let query = format ! (
404+ r#"select "ema{}il" from auth.users"# ,
405+ QueryWithCursorPosition :: cursor_marker( )
406+ ) ;
407+
408+ test_hover_at_cursor (
409+ "column_hover_quoted_column_name" ,
410+ query,
411+ Some ( setup) ,
412+ & test_db,
413+ )
414+ . await ;
415+ }
416+
417+ #[ sqlx:: test( migrator = "pgt_test_utils::MIGRATIONS" ) ]
418+ async fn test_column_hover_with_quoted_column_name_with_table ( test_db : PgPool ) {
419+ let setup = r#"
420+ create table users (
421+ id serial primary key,
422+ email varchar(255) not null
423+ );
424+
425+ create table phone_nums (
426+ phone_id serial primary key,
427+ email varchar(255) not null,
428+ phone int
429+ );
430+ "# ;
431+
432+ let query = format ! (
433+ r#"select phone, id from users join phone_nums on "users"."em{}ail" = phone_nums.email;"# ,
434+ QueryWithCursorPosition :: cursor_marker( )
435+ ) ;
436+
437+ test_hover_at_cursor (
438+ "column_hover_quoted_column_name_with_table" ,
439+ query,
440+ Some ( setup) ,
441+ & test_db,
442+ )
443+ . await ;
444+ }
445+
303446async fn test_policy_table_hover ( test_db : PgPool ) {
304447 let setup = r#"
305448 create table users (
0 commit comments