@@ -8,12 +8,11 @@ import { getPool, PoolConfig } from './driver';
88import { storageKey , globalConnPool , globalLspClient } from './extension' ;
99import { getCompiledLSPBinaryPath , sqlsDriverFromDriver } from './lsp' ;
1010
11- export const deleteConnectionConfiguration =
12- (
13- context : vscode . ExtensionContext ,
14- connectionsSidepanel : SQLNotebookConnections
15- ) =>
16- async ( item : ConnectionListItem ) => {
11+ export function deleteConnectionConfiguration (
12+ context : vscode . ExtensionContext ,
13+ connectionsSidepanel : SQLNotebookConnections
14+ ) {
15+ return async ( item : ConnectionListItem ) => {
1716 const without = context . globalState
1817 . get < ConnData [ ] > ( storageKey , [ ] )
1918 . filter ( ( { name } ) => name !== item . config . name ) ;
@@ -26,13 +25,13 @@ export const deleteConnectionConfiguration =
2625 ) ;
2726 connectionsSidepanel . refresh ( ) ;
2827 } ;
28+ }
2929
30- export const connectToDatabase =
31- (
32- context : vscode . ExtensionContext ,
33- connectionsSidepanel : SQLNotebookConnections
34- ) =>
35- async ( item ?: ConnectionListItem ) => {
30+ export function connectToDatabase (
31+ context : vscode . ExtensionContext ,
32+ connectionsSidepanel : SQLNotebookConnections
33+ ) {
34+ return async ( item ?: ConnectionListItem ) => {
3635 let selectedName : string ;
3736 if ( ! item ) {
3837 const names = context . globalState
@@ -94,13 +93,15 @@ export const connectToDatabase =
9493 connectionsSidepanel . setActive ( null ) ;
9594 }
9695 } ;
96+ }
9797
9898function startLanguageServer ( conn : ConnData , password ?: string ) {
9999 try {
100100 const driver = sqlsDriverFromDriver ( conn . driver ) ;
101101 const binPath = getCompiledLSPBinaryPath ( ) ;
102- if ( ! binPath )
102+ if ( ! binPath ) {
103103 throw Error ( 'Platform not supported, language server disabled.' ) ;
104+ }
104105 if ( driver ) {
105106 globalLspClient . start ( {
106107 binPath,
0 commit comments