[clang-tools-extra] r326452 - [clangd] Forward all environment variables along with CLANGD_TRACE to clangd.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 1 09:42:27 PST 2018


Author: ioeric
Date: Thu Mar  1 09:42:27 2018
New Revision: 326452

URL: http://llvm.org/viewvc/llvm-project?rev=326452&view=rev
Log:
[clangd] Forward all environment variables along with CLANGD_TRACE to clangd.

Modified:
    clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts

Modified: clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts?rev=326452&r1=326451&r2=326452&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts (original)
+++ clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts Thu Mar  1 09:42:27 2018
@@ -23,8 +23,10 @@ export function activate(context: vscode
         args: getConfig<string[]>('arguments')
     };
     const traceFile = getConfig<string>('trace');
-    if (traceFile != null)
-        clangd.options = {env: {CLANGD_TRACE: traceFile}};
+    if (traceFile != '') {
+      const trace = {CLANGD_TRACE : traceFile};
+      clangd.options = {env : {...process.env, ...trace}};
+    }
     const serverOptions: vscodelc.ServerOptions = clangd;
 
     const filePattern: string = '**/*.{' +




More information about the cfe-commits mailing list