MCPcopy Create free account
hub / github.com/cmoog/vscode-sql-notebook / startLanguageServer

Function startLanguageServer

src/commands.ts:108–141  ·  view source on GitHub ↗
(conn: ConnData, password?: string)

Source from the content-addressed store, hash-verified

106}
107
108function 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
143function shouldUseLanguageServer(): boolean {
144 return (

Callers 1

connectToDatabaseFunction · 0.85

Calls 3

sqlsDriverFromDriverFunction · 0.90
getCompiledLSPBinaryPathFunction · 0.90
startMethod · 0.80

Tested by

no test coverage detected