@@ -10,15 +10,15 @@ use async_helper::run_async;
1010use connection_manager:: ConnectionManager ;
1111use dashmap:: DashMap ;
1212use document:: Document ;
13- use futures:: { stream , StreamExt } ;
13+ use futures:: { StreamExt , stream } ;
1414use parsed_document:: {
1515 AsyncDiagnosticsMapper , CursorPositionFilter , DefaultMapper , ExecuteStatementMapper ,
1616 ParsedDocument , SyncDiagnosticsMapper ,
1717} ;
1818use pgt_analyse:: { AnalyserOptions , AnalysisFilter } ;
1919use pgt_analyser:: { Analyser , AnalyserConfig , AnalyserContext } ;
2020use pgt_diagnostics:: {
21- serde :: Diagnostic as SDiagnostic , Diagnostic , DiagnosticExt , Error , Severity ,
21+ Diagnostic , DiagnosticExt , Error , Severity , serde :: Diagnostic as SDiagnostic ,
2222} ;
2323use pgt_fs:: { ConfigName , PgTPath } ;
2424use pgt_typecheck:: { IdentifierType , TypecheckParams , TypedIdentifier } ;
@@ -27,20 +27,17 @@ use sqlx::{Executor, PgPool};
2727use tracing:: { debug, info} ;
2828
2929use crate :: {
30+ WorkspaceError ,
3031 configuration:: to_analyser_rules,
3132 features:: {
3233 code_actions:: {
3334 self , CodeAction , CodeActionKind , CodeActionsResult , CommandAction ,
3435 CommandActionCategory , ExecuteStatementParams , ExecuteStatementResult ,
3536 } ,
36- completions:: { get_statement_for_completions , CompletionsResult , GetCompletionsParams } ,
37+ completions:: { CompletionsResult , GetCompletionsParams , get_statement_for_completions } ,
3738 diagnostics:: { PullDiagnosticsParams , PullDiagnosticsResult } ,
3839 } ,
39- settings:: {
40- Settings , SettingsHandle , SettingsHandleMut , WorkspaceSettings , WorkspaceSettingsHandle ,
41- WorkspaceSettingsHandleMut ,
42- } ,
43- WorkspaceError ,
40+ settings:: { WorkspaceSettings , WorkspaceSettingsHandle , WorkspaceSettingsHandleMut } ,
4441} ;
4542
4643use super :: {
@@ -55,6 +52,7 @@ mod analyser;
5552mod annotation;
5653mod async_helper;
5754mod change;
55+ mod connection_key;
5856mod connection_manager;
5957pub ( crate ) mod document;
6058mod migration;
@@ -444,15 +442,14 @@ impl Workspace for WorkspaceServer {
444442 if let Some ( pool) = self . get_current_connection ( ) {
445443 let path_clone = params. path . clone ( ) ;
446444 let schema_cache = self . schema_cache . load ( pool. clone ( ) ) ?;
447- let schema_cache_arc = schema_cache. get_arc ( ) ;
448445 let input = parser. iter ( AsyncDiagnosticsMapper ) . collect :: < Vec < _ > > ( ) ;
449446 // sorry for the ugly code :(
450447 let async_results = run_async ( async move {
451448 stream:: iter ( input)
452449 . map ( |( _id, range, content, ast, cst, sign) | {
453450 let pool = pool. clone ( ) ;
454451 let path = path_clone. clone ( ) ;
455- let schema_cache = Arc :: clone ( & schema_cache_arc ) ;
452+ let schema_cache = Arc :: clone ( & schema_cache ) ;
456453 async move {
457454 if let Some ( ast) = ast {
458455 pgt_typecheck:: check_sql ( TypecheckParams {
0 commit comments