Index: clangd/clients/clangd-vscode/package.json =================================================================== --- clangd/clients/clangd-vscode/package.json +++ clangd/clients/clangd-vscode/package.json @@ -43,8 +43,8 @@ "@types/mocha": "^2.2.32" }, "repository": { - "type": "svn", - "url": "http://llvm.org/svn/llvm-project/clang-tools-extra/trunk/clangd/clients/clangd-vscode/" + "type": "svn", + "url": "http://llvm.org/svn/llvm-project/clang-tools-extra/trunk/clangd/clients/clangd-vscode/" }, "contributes": { "configuration": { @@ -68,6 +68,10 @@ "type": "boolean", "default": true, "description": "Whether or not to send file events to clangd (File created, changed or deleted). This can be disabled for performance consideration." + }, + "clangd.trace": { + "type": "string", + "description": "Names a file that clangd should log a performance trace to, in chrome trace-viewer JSON format." } } } Index: clangd/clients/clangd-vscode/src/extension.ts =================================================================== --- clangd/clients/clangd-vscode/src/extension.ts +++ clangd/clients/clangd-vscode/src/extension.ts @@ -16,11 +16,16 @@ * your extension is activated the very first time the command is executed */ export function activate(context: vscode.ExtensionContext) { - const clangdPath = getConfig('path'); - const clangdArgs = getConfig('arguments'); const syncFileEvents = getConfig('syncFileEvents', true); - const serverOptions: vscodelc.ServerOptions = { command: clangdPath, args: clangdArgs }; + const clangd: vscodelc.Executable = { + command: getConfig('path'), + args: getConfig('arguments') + }; + const traceFile = getConfig('trace'); + if (traceFile != null) + clangd.options = {env: {CLANGD_TRACE: traceFile}}; + const serverOptions: vscodelc.ServerOptions = clangd; const filePattern: string = '**/*.{' + ['cpp', 'c', 'cc', 'cxx', 'c++', 'm', 'mm', 'h', 'hh', 'hpp', 'hxx', 'inc'].join() + '}';