From 79a6364f19fc2668827da319ed8e4c8b3d834076 Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Tue, 17 Jun 2025 14:42:46 -0700 Subject: [PATCH 01/10] set env variables using IDE settings --- .../core/src/shared/lsp/utils/platform.ts | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 39284e8a0ac..af5eee6a0cc 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -8,6 +8,7 @@ import { Logger } from '../../logger/logger' import { ChildProcess } from '../../utilities/processUtils' import { waitUntil } from '../../utilities/timeoutUtils' import { isDebugInstance } from '../../vscode/env' +import * as vscode from 'vscode' export function getNodeExecutableName(): string { return process.platform === 'win32' ? 'node.exe' : 'node' @@ -81,18 +82,75 @@ export async function validateNodeExe(nodePath: string[], lsp: string, args: str } } +/** + * Gets proxy settings from VS Code configuration + */ +export function getVSCodeProxySettings(): { proxyUrl?: string; proxyBypassRules?: string; certificatePath?: string } { + try { + const result: { proxyUrl?: string; proxyBypassRules?: string; certificatePath?: string } = {} + + // Get proxy settings from VS Code configuration + const httpConfig = vscode.workspace.getConfiguration('http') + const proxy = httpConfig.get('proxy') + + if (proxy) { + result.proxyUrl = proxy + } + + // Try to get system certificates + try { + // @ts-ignore - This is a valid access pattern in VSCode extensions + const electron = require('electron') + if (electron?.net?.getCACertificates) { + const certs = electron.net.getCACertificates() + if (certs && certs.length > 0) { + // Create a temporary file with the certificates + const os = require('os') + const fs = require('fs') + const path = require('path') + + const certContent = certs + .map((cert: any) => cert.pemEncoded) + .filter(Boolean) + .join('\\n') + + if (certContent) { + const tempDir = path.join(os.tmpdir(), 'aws-toolkit-vscode') + if (!fs.existsSync(tempDir)) { + fs.mkdirSync(tempDir, { recursive: true }) + } + + const certPath = path.join(tempDir, 'vscode-ca-certs.pem') + fs.writeFileSync(certPath, certContent) + result.certificatePath = certPath + } + } + } + } catch (err) { + // Silently fail if we can't access certificates + } + + return result + } catch (err) { + // Silently fail if we can't access VS Code configuration + return {} + } +} + export function createServerOptions({ encryptionKey, executable, serverModule, execArgv, warnThresholds, + env, }: { encryptionKey: Buffer executable: string[] serverModule: string execArgv: string[] warnThresholds?: { cpu?: number; memory?: number } + env?: Record }) { return async () => { const bin = executable[0] @@ -100,7 +158,49 @@ export function createServerOptions({ if (isDebugInstance()) { args.unshift('--inspect=6080') } - const lspProcess = new ChildProcess(bin, args, { warnThresholds }) + + // Merge environment variables + const processEnv = { ...process.env } + if (env) { + Object.assign(processEnv, env) + } + + // Get proxy settings from VS Code + const proxySettings = getVSCodeProxySettings() + + // Add proxy settings to the Node.js process + if (proxySettings.proxyUrl) { + processEnv.HTTPS_PROXY = proxySettings.proxyUrl + processEnv.HTTP_PROXY = proxySettings.proxyUrl + processEnv.https_proxy = proxySettings.proxyUrl + processEnv.http_proxy = proxySettings.proxyUrl + } + + // Add certificate path if available + if (proxySettings.certificatePath) { + processEnv.NODE_EXTRA_CA_CERTS = proxySettings.certificatePath + } + + // Enable Node.js to use system CA certificates as a fallback + if (!processEnv.NODE_EXTRA_CA_CERTS) { + processEnv.NODE_TLS_USE_SYSTEM_CA_STORE = '1' + } + + // Get SSL verification settings + const httpConfig = vscode.workspace.getConfiguration('http') + const strictSSL = httpConfig.get('proxyStrictSSL', true) + + // Handle SSL certificate verification + if (!strictSSL) { + processEnv.NODE_TLS_REJECT_UNAUTHORIZED = '0' + } + + const lspProcess = new ChildProcess(bin, args, { + warnThresholds, + spawnOptions: { + env: processEnv, + }, + }) // this is a long running process, awaiting it will never resolve void lspProcess.run() From 1ac761f87e770b235dd201f58dd8b6d52f4b6f76 Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Tue, 17 Jun 2025 15:10:54 -0700 Subject: [PATCH 02/10] handle certs --- .../core/src/shared/lsp/utils/platform.ts | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index af5eee6a0cc..5d6bb12fe1a 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -4,7 +4,7 @@ */ import { ToolkitError } from '../../errors' -import { Logger } from '../../logger/logger' +import { Logger, getLogger } from '../../logger/logger' import { ChildProcess } from '../../utilities/processUtils' import { waitUntil } from '../../utilities/timeoutUtils' import { isDebugInstance } from '../../vscode/env' @@ -83,57 +83,65 @@ export async function validateNodeExe(nodePath: string[], lsp: string, args: str } /** - * Gets proxy settings from VS Code configuration + * Gets proxy settings and certificates from VS Code */ -export function getVSCodeProxySettings(): { proxyUrl?: string; proxyBypassRules?: string; certificatePath?: string } { +export function getVSCodeSettings(): { proxyUrl?: string; certificatePath?: string } { + const result: { proxyUrl?: string; certificatePath?: string } = {} + const logger = getLogger('amazonqLsp') + try { - const result: { proxyUrl?: string; proxyBypassRules?: string; certificatePath?: string } = {} + // Check if user already has NODE_EXTRA_CA_CERTS set + const userCerts = process.env.NODE_EXTRA_CA_CERTS + if (userCerts) { + logger.info(`User already has NODE_EXTRA_CA_CERTS set: ${userCerts}`) + return result + } // Get proxy settings from VS Code configuration const httpConfig = vscode.workspace.getConfiguration('http') const proxy = httpConfig.get('proxy') - if (proxy) { result.proxyUrl = proxy + logger.info(`Using proxy from VS Code settings: ${proxy}`) } - // Try to get system certificates try { // @ts-ignore - This is a valid access pattern in VSCode extensions const electron = require('electron') if (electron?.net?.getCACertificates) { const certs = electron.net.getCACertificates() if (certs && certs.length > 0) { - // Create a temporary file with the certificates - const os = require('os') + logger.info(`Found ${certs.length} certificates in VS Code's trust store`) + + // Create a temporary file with certificates const fs = require('fs') + const os = require('os') const path = require('path') + const tempDir = path.join(os.tmpdir(), 'aws-toolkit-vscode') + if (!fs.existsSync(tempDir)) { + fs.mkdirSync(tempDir, { recursive: true }) + } + + const certPath = path.join(tempDir, 'vscode-ca-certs.pem') const certContent = certs + .filter((cert: any) => cert.pemEncoded) .map((cert: any) => cert.pemEncoded) - .filter(Boolean) - .join('\\n') - - if (certContent) { - const tempDir = path.join(os.tmpdir(), 'aws-toolkit-vscode') - if (!fs.existsSync(tempDir)) { - fs.mkdirSync(tempDir, { recursive: true }) - } - - const certPath = path.join(tempDir, 'vscode-ca-certs.pem') - fs.writeFileSync(certPath, certContent) - result.certificatePath = certPath - } + .join('\n') + + fs.writeFileSync(certPath, certContent) + result.certificatePath = certPath + logger.info(`Created certificate file at: ${certPath}`) } } } catch (err) { - // Silently fail if we can't access certificates + logger.error(`Failed to extract certificates: ${err}`) } return result } catch (err) { - // Silently fail if we can't access VS Code configuration - return {} + logger.error(`Failed to get VS Code settings: ${err}`) + return result } } @@ -165,25 +173,22 @@ export function createServerOptions({ Object.assign(processEnv, env) } - // Get proxy settings from VS Code - const proxySettings = getVSCodeProxySettings() + // Get settings from VS Code + const settings = getVSCodeSettings() + const logger = getLogger('amazonqLsp') // Add proxy settings to the Node.js process - if (proxySettings.proxyUrl) { - processEnv.HTTPS_PROXY = proxySettings.proxyUrl - processEnv.HTTP_PROXY = proxySettings.proxyUrl - processEnv.https_proxy = proxySettings.proxyUrl - processEnv.http_proxy = proxySettings.proxyUrl + if (settings.proxyUrl) { + processEnv.HTTPS_PROXY = settings.proxyUrl + processEnv.HTTP_PROXY = settings.proxyUrl + processEnv.https_proxy = settings.proxyUrl + processEnv.http_proxy = settings.proxyUrl } // Add certificate path if available - if (proxySettings.certificatePath) { - processEnv.NODE_EXTRA_CA_CERTS = proxySettings.certificatePath - } - - // Enable Node.js to use system CA certificates as a fallback - if (!processEnv.NODE_EXTRA_CA_CERTS) { - processEnv.NODE_TLS_USE_SYSTEM_CA_STORE = '1' + if (settings.certificatePath) { + processEnv.NODE_EXTRA_CA_CERTS = settings.certificatePath + logger.info(`Using certificate file: ${settings.certificatePath}`) } // Get SSL verification settings @@ -193,6 +198,7 @@ export function createServerOptions({ // Handle SSL certificate verification if (!strictSSL) { processEnv.NODE_TLS_REJECT_UNAUTHORIZED = '0' + logger.info('SSL verification disabled via VS Code settings') } const lspProcess = new ChildProcess(bin, args, { From fcbc5b068ffd08748ba4d17f32a667ed80dd654d Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Tue, 17 Jun 2025 17:46:37 -0700 Subject: [PATCH 03/10] use tls instead --- .../core/src/shared/lsp/utils/platform.ts | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 5d6bb12fe1a..38a52026aeb 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -8,7 +8,11 @@ import { Logger, getLogger } from '../../logger/logger' import { ChildProcess } from '../../utilities/processUtils' import { waitUntil } from '../../utilities/timeoutUtils' import { isDebugInstance } from '../../vscode/env' +import { tmpdir } from 'os' +import { join } from 'path' +import * as fs from 'fs' import * as vscode from 'vscode' +import * as tls from 'tls' export function getNodeExecutableName(): string { return process.platform === 'win32' ? 'node.exe' : 'node' @@ -106,33 +110,23 @@ export function getVSCodeSettings(): { proxyUrl?: string; certificatePath?: stri } try { - // @ts-ignore - This is a valid access pattern in VSCode extensions - const electron = require('electron') - if (electron?.net?.getCACertificates) { - const certs = electron.net.getCACertificates() - if (certs && certs.length > 0) { - logger.info(`Found ${certs.length} certificates in VS Code's trust store`) - - // Create a temporary file with certificates - const fs = require('fs') - const os = require('os') - const path = require('path') - - const tempDir = path.join(os.tmpdir(), 'aws-toolkit-vscode') - if (!fs.existsSync(tempDir)) { - fs.mkdirSync(tempDir, { recursive: true }) - } - - const certPath = path.join(tempDir, 'vscode-ca-certs.pem') - const certContent = certs - .filter((cert: any) => cert.pemEncoded) - .map((cert: any) => cert.pemEncoded) - .join('\n') - - fs.writeFileSync(certPath, certContent) - result.certificatePath = certPath - logger.info(`Created certificate file at: ${certPath}`) + // @ts-ignore - we need this function to access certs + const certs = tls.getCACertificates() + if (certs && certs.length > 0) { + logger.info(`Found ${certs.length} certificates in VS Code's trust store`) + + // Create a temporary file with certificates + const tempDir = join(tmpdir(), 'aws-toolkit-vscode') + if (!fs.existsSync(tempDir)) { + fs.mkdirSync(tempDir, { recursive: true }) } + + const certPath = join(tempDir, 'vscode-ca-certs.pem') + const certContent = certs.join('\n') + + fs.writeFileSync(certPath, certContent) + result.certificatePath = certPath + logger.info(`Created certificate file at: ${certPath}`) } } catch (err) { logger.error(`Failed to extract certificates: ${err}`) From 006e55de5892f1d8abbb62f9d01f05ce695eb449 Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Tue, 17 Jun 2025 18:25:09 -0700 Subject: [PATCH 04/10] hack to make this build --- packages/core/src/shared/lsp/utils/platform.ts | 1 + packages/webpack.base.config.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 38a52026aeb..3961660bc3c 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -10,6 +10,7 @@ import { waitUntil } from '../../utilities/timeoutUtils' import { isDebugInstance } from '../../vscode/env' import { tmpdir } from 'os' import { join } from 'path' +// eslint-disable-next-line no-restricted-imports import * as fs from 'fs' import * as vscode from 'vscode' import * as tls from 'tls' diff --git a/packages/webpack.base.config.js b/packages/webpack.base.config.js index 652249e6577..59a460456cf 100644 --- a/packages/webpack.base.config.js +++ b/packages/webpack.base.config.js @@ -38,6 +38,10 @@ module.exports = (env = {}, argv = {}) => { externals: { vscode: 'commonjs vscode', vue: 'root Vue', + fs: 'commonjs fs', + path: 'commonjs path', + os: 'commonjs os', + tls: 'commonjs tls', }, resolve: { extensions: ['.ts', '.js'], From 8bb0e3e1c09d6faab7b7150b582615d149a6201a Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Tue, 17 Jun 2025 21:29:07 -0700 Subject: [PATCH 05/10] fix import --- packages/core/src/shared/lsp/utils/platform.ts | 9 ++++----- packages/webpack.base.config.js | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 3961660bc3c..90cf1304a41 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -10,8 +10,7 @@ import { waitUntil } from '../../utilities/timeoutUtils' import { isDebugInstance } from '../../vscode/env' import { tmpdir } from 'os' import { join } from 'path' -// eslint-disable-next-line no-restricted-imports -import * as fs from 'fs' +import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports import * as vscode from 'vscode' import * as tls from 'tls' @@ -118,14 +117,14 @@ export function getVSCodeSettings(): { proxyUrl?: string; certificatePath?: stri // Create a temporary file with certificates const tempDir = join(tmpdir(), 'aws-toolkit-vscode') - if (!fs.existsSync(tempDir)) { - fs.mkdirSync(tempDir, { recursive: true }) + if (!nodefs.existsSync(tempDir)) { + nodefs.mkdirSync(tempDir, { recursive: true }) } const certPath = join(tempDir, 'vscode-ca-certs.pem') const certContent = certs.join('\n') - fs.writeFileSync(certPath, certContent) + nodefs.writeFileSync(certPath, certContent) result.certificatePath = certPath logger.info(`Created certificate file at: ${certPath}`) } diff --git a/packages/webpack.base.config.js b/packages/webpack.base.config.js index 59a460456cf..9f281a23cd0 100644 --- a/packages/webpack.base.config.js +++ b/packages/webpack.base.config.js @@ -38,9 +38,6 @@ module.exports = (env = {}, argv = {}) => { externals: { vscode: 'commonjs vscode', vue: 'root Vue', - fs: 'commonjs fs', - path: 'commonjs path', - os: 'commonjs os', tls: 'commonjs tls', }, resolve: { From f6083b83d33fe256bc44a868ba001d4e272ee2d2 Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Wed, 18 Jun 2025 10:35:32 -0700 Subject: [PATCH 06/10] get system certs --- .../core/src/shared/lsp/utils/platform.ts | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 90cf1304a41..9df7a0052a8 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -12,7 +12,6 @@ import { tmpdir } from 'os' import { join } from 'path' import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports import * as vscode from 'vscode' -import * as tls from 'tls' export function getNodeExecutableName(): string { return process.platform === 'win32' ? 'node.exe' : 'node' @@ -89,18 +88,11 @@ export async function validateNodeExe(nodePath: string[], lsp: string, args: str /** * Gets proxy settings and certificates from VS Code */ -export function getVSCodeSettings(): { proxyUrl?: string; certificatePath?: string } { +export async function getVSCodeSettings(): Promise<{ proxyUrl?: string; certificatePath?: string }> { const result: { proxyUrl?: string; certificatePath?: string } = {} const logger = getLogger('amazonqLsp') try { - // Check if user already has NODE_EXTRA_CA_CERTS set - const userCerts = process.env.NODE_EXTRA_CA_CERTS - if (userCerts) { - logger.info(`User already has NODE_EXTRA_CA_CERTS set: ${userCerts}`) - return result - } - // Get proxy settings from VS Code configuration const httpConfig = vscode.workspace.getConfiguration('http') const proxy = httpConfig.get('proxy') @@ -110,10 +102,18 @@ export function getVSCodeSettings(): { proxyUrl?: string; certificatePath?: stri } try { - // @ts-ignore - we need this function to access certs - const certs = tls.getCACertificates() - if (certs && certs.length > 0) { - logger.info(`Found ${certs.length} certificates in VS Code's trust store`) + const tls = await import('node:tls') + + // @ts-ignore Get system certificates + const systemCerts = tls.getCACertificates('system') + + // @ts-ignore Get any existing extra certificates + const extraCerts = tls.getCACertificates('extra') + + // Combine all certificates + const allCerts = [...systemCerts, ...extraCerts] + if (allCerts && allCerts.length > 0) { + logger.info(`Found ${allCerts.length} certificates in system's trust store`) // Create a temporary file with certificates const tempDir = join(tmpdir(), 'aws-toolkit-vscode') @@ -122,7 +122,7 @@ export function getVSCodeSettings(): { proxyUrl?: string; certificatePath?: stri } const certPath = join(tempDir, 'vscode-ca-certs.pem') - const certContent = certs.join('\n') + const certContent = allCerts.join('\n') nodefs.writeFileSync(certPath, certContent) result.certificatePath = certPath @@ -168,15 +168,12 @@ export function createServerOptions({ } // Get settings from VS Code - const settings = getVSCodeSettings() + const settings = await getVSCodeSettings() const logger = getLogger('amazonqLsp') // Add proxy settings to the Node.js process if (settings.proxyUrl) { processEnv.HTTPS_PROXY = settings.proxyUrl - processEnv.HTTP_PROXY = settings.proxyUrl - processEnv.https_proxy = settings.proxyUrl - processEnv.http_proxy = settings.proxyUrl } // Add certificate path if available From b3a1f779ac9b463952d092a7c8f10c26fbf7961e Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Wed, 18 Jun 2025 15:32:18 -0700 Subject: [PATCH 07/10] fix import --- packages/core/src/shared/lsp/utils/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 9df7a0052a8..728ee94c835 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -102,7 +102,7 @@ export async function getVSCodeSettings(): Promise<{ proxyUrl?: string; certific } try { - const tls = await import('node:tls') + const tls = await import('tls') // @ts-ignore Get system certificates const systemCerts = tls.getCACertificates('system') From 6b3adec82d024a068f3189ed5cf837b3e533257e Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Wed, 18 Jun 2025 16:35:12 -0700 Subject: [PATCH 08/10] no nesting try-catch --- .../core/src/shared/lsp/utils/platform.ts | 57 ++++++++----------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 728ee94c835..30ea5d6ed66 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -100,43 +100,36 @@ export async function getVSCodeSettings(): Promise<{ proxyUrl?: string; certific result.proxyUrl = proxy logger.info(`Using proxy from VS Code settings: ${proxy}`) } + } catch (err) { + logger.error(`Failed to get VS Code settings: ${err}`) + return result + } + try { + const tls = await import('tls') + // @ts-ignore Get system certificates + const systemCerts = tls.getCACertificates('system') + // @ts-ignore Get any existing extra certificates + const extraCerts = tls.getCACertificates('extra') + const allCerts = [...systemCerts, ...extraCerts] + if (allCerts && allCerts.length > 0) { + logger.info(`Found ${allCerts.length} certificates in system's trust store`) + + const tempDir = join(tmpdir(), 'aws-toolkit-vscode') + if (!nodefs.existsSync(tempDir)) { + nodefs.mkdirSync(tempDir, { recursive: true }) + } - try { - const tls = await import('tls') - - // @ts-ignore Get system certificates - const systemCerts = tls.getCACertificates('system') - - // @ts-ignore Get any existing extra certificates - const extraCerts = tls.getCACertificates('extra') - - // Combine all certificates - const allCerts = [...systemCerts, ...extraCerts] - if (allCerts && allCerts.length > 0) { - logger.info(`Found ${allCerts.length} certificates in system's trust store`) - - // Create a temporary file with certificates - const tempDir = join(tmpdir(), 'aws-toolkit-vscode') - if (!nodefs.existsSync(tempDir)) { - nodefs.mkdirSync(tempDir, { recursive: true }) - } - - const certPath = join(tempDir, 'vscode-ca-certs.pem') - const certContent = allCerts.join('\n') + const certPath = join(tempDir, 'vscode-ca-certs.pem') + const certContent = allCerts.join('\n') - nodefs.writeFileSync(certPath, certContent) - result.certificatePath = certPath - logger.info(`Created certificate file at: ${certPath}`) - } - } catch (err) { - logger.error(`Failed to extract certificates: ${err}`) + nodefs.writeFileSync(certPath, certContent) + result.certificatePath = certPath + logger.info(`Created certificate file at: ${certPath}`) } - - return result } catch (err) { - logger.error(`Failed to get VS Code settings: ${err}`) - return result + logger.error(`Failed to extract certificates: ${err}`) } + return result } export function createServerOptions({ From 27a5a68e64c632a1cb39b68fd713170d8581faea Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Thu, 19 Jun 2025 13:34:47 -0700 Subject: [PATCH 09/10] remove extra newline --- packages/core/src/shared/lsp/utils/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 30ea5d6ed66..0acd4ad9cb6 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -120,7 +120,7 @@ export async function getVSCodeSettings(): Promise<{ proxyUrl?: string; certific } const certPath = join(tempDir, 'vscode-ca-certs.pem') - const certContent = allCerts.join('\n') + const certContent = allCerts.join('') nodefs.writeFileSync(certPath, certContent) result.certificatePath = certPath From 5800ac5eb08b6e17d9f972c2e2d4fdb959b97a6c Mon Sep 17 00:00:00 2001 From: samgst-amazon Date: Fri, 20 Jun 2025 09:42:38 -0700 Subject: [PATCH 10/10] actually we do need the newline --- packages/core/src/shared/lsp/utils/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 0acd4ad9cb6..30ea5d6ed66 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -120,7 +120,7 @@ export async function getVSCodeSettings(): Promise<{ proxyUrl?: string; certific } const certPath = join(tempDir, 'vscode-ca-certs.pem') - const certContent = allCerts.join('') + const certContent = allCerts.join('\n') nodefs.writeFileSync(certPath, certContent) result.certificatePath = certPath