(conn: ConnData, password?: string)
| 106 | } |
| 107 | |
| 108 | function startLanguageServer(conn: ConnData, password?: string) { |
| 109 | if (conn.driver === 'sqlite') { |
| 110 | vscode.window.showWarningMessage( |
| 111 | `Driver ${conn.driver} not supported by language server. Completion support disabled.` |
| 112 | ); |
| 113 | return; |
| 114 | } |
| 115 | try { |
| 116 | const driver = sqlsDriverFromDriver(conn.driver); |
| 117 | const binPath = getCompiledLSPBinaryPath(); |
| 118 | if (!binPath) { |
| 119 | throw Error('Platform not supported, language server disabled.'); |
| 120 | } |
| 121 | if (driver) { |
| 122 | globalLspClient.start({ |
| 123 | binPath, |
| 124 | host: conn.host, |
| 125 | port: conn.port, |
| 126 | password: password, |
| 127 | driver, |
| 128 | database: conn.database, |
| 129 | user: conn.user, |
| 130 | }); |
| 131 | } else { |
| 132 | vscode.window.showWarningMessage( |
| 133 | `Driver ${conn.driver} not supported by language server. Completion support disabled.` |
| 134 | ); |
| 135 | } |
| 136 | } catch (e) { |
| 137 | vscode.window.showWarningMessage( |
| 138 | `Language server failed to initialize: ${e}` |
| 139 | ); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | function shouldUseLanguageServer(): boolean { |
| 144 | return ( |
no test coverage detected