| 1888 | let _lspAttempted = false; |
| 1889 | |
| 1890 | async function initLSP() { |
| 1891 | if (_lspAttempted) return _lspClient; |
| 1892 | _lspAttempted = true; |
| 1893 | try { |
| 1894 | const { LSPClient } = require('../src/lsp/client'); |
| 1895 | const client = new LSPClient(process.cwd()); |
| 1896 | const ok = await client.start(); |
| 1897 | if (ok) { |
| 1898 | _lspClient = client; |
| 1899 | if (_fullscreenRef) _fullscreenRef.addTool('lsp', 'ok', `${client.serverInfo.language} language server connected`); |
| 1900 | } |
| 1901 | } catch {} |
| 1902 | return _lspClient; |
| 1903 | } |
| 1904 | |
| 1905 | // runValidation: delegate to the hardened version in model_client.js |
| 1906 | // which uses execFileSync with arg arrays (no shell injection via filePath). |