diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json b/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json --- a/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json +++ b/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json @@ -1,4 +1,4 @@ -// A launch configuration that compiles the extension and then opens it inside a new window +// A launch configuration that compiles extension and opens it inside a new window. { "version": "0.1.0", "configurations": [ diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/tasks.json b/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/tasks.json --- a/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/tasks.json +++ b/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/tasks.json @@ -6,25 +6,27 @@ // ${fileExtname}: the current opened file's extension // ${cwd}: the current working directory of the spawned process -// A task runner that calls a custom npm script that compiles the extension. +// Task runner calls custom npm script to compile the extension. { - "version": "0.1.0", + "version": "2.0.0", - // we want to run npm + // Run NPM. "command": "npm", - // the command is a shell script - "isShellCommand": true, + // This command is a shell script. + "type": "shell", // show the output window only if unrecognized errors occur. - "showOutput": "silent", + "presentation": { + "reveal": "silent", + }, - // we run the custom script "compile" as defined in package.json + // Run custom "compile" script as defined in package.json "args": ["run", "compile", "--loglevel", "silent"], - // The tsc compiler is started in watching mode - "isWatching": true, + // tsc compiler is kept alive and runs in the background. + "isBackground": true, - // use the standard tsc in watch mode problem matcher to find compile problems in the output. + // Find compilation problems in the output through tsc in watch mode. "problemMatcher": "$tsc-watch" -} \ No newline at end of file +} diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md b/clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md --- a/clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md +++ b/clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md @@ -10,20 +10,20 @@ ## Steps 1. Make sure you disable the installed `vscode-clangd` extension in VS Code. -2. Make sure you have clangd in /usr/bin/clangd or edit src/extension.ts to +2. Make sure you have clangd in `/usr/bin/clangd` or edit `src/extension.ts` to point to the binary. -3. In order to start a development instance of VS code extended with this, run: +3. To start a development instance of VS code extended with this, run: ```bash $ cd /path/to/clang-tools-extra/clangd/clients/clangd-vscode/ $ npm install $ code . - # When VS Code starts, press . + # When VSCode starts, press . ``` # Contributing -Please follow the exsiting code style when contributing to the extension, we +Please follow the existing code style when contributing to the extension, we recommend to run `npm run format` before sending a patch. # Publish to VS Code Marketplace @@ -38,15 +38,15 @@ * Bump the version in `package.json`, and commit the change to upstream The extension is published under `llvm-vs-code-extensions` account, which is -currently maintained by clangd developers. If you want to make a new release, -please contact clangd-dev@lists.llvm.org. +maintained by clangd developers. If you want to make a new release, please +contact clangd-dev@lists.llvm.org. ## Steps ```bash $ cd /path/to/clang-tools-extra/clangd/clients/clangd-vscode/ - # For the first time, you need to login in the account. vsce will ask you for - the Personal Access Token, and remember it for future commands. + # For the first time, you need to login into the account. vsce will ask you + for the Personal Access Token and will remember it for future commands. $ vsce login llvm-vs-code-extensions # Publish the extension to the VSCode marketplace. $ npm run publish diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts b/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts --- a/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts +++ b/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts @@ -3,7 +3,7 @@ import * as semanticHighlighting from './semantic-highlighting'; /** - * Method to get workspace configuration option + * Get an option from workspace configuration. * @param option name of the option (e.g. for clangd.path should be path) * @param defaultValue default value to return if option is not set */ @@ -75,8 +75,8 @@ } /** - * this method is called when your extension is activate - * your extension is activated the very first time the command is executed + * This method is called when the extension is activated. The extension is + * activated the very first time a command is executed. */ export function activate(context: vscode.ExtensionContext) { const syncFileEvents = getConfig('syncFileEvents', true); @@ -97,7 +97,7 @@ documentSelector: [ { scheme: 'file', language: 'c' }, { scheme: 'file', language: 'cpp' }, - // cuda is not supported by vscode, but our extension does. + // CUDA is not supported by vscode, but our extension does supports it. { scheme: 'file', language: 'cuda' }, { scheme: 'file', language: 'objective-c'}, { scheme: 'file', language: 'objective-cpp'} @@ -106,7 +106,7 @@ // FIXME: send sync file events when clangd provides implementations. }, initializationOptions: { clangdFileStatus: true }, - // Do not switch to output window when clangd returns output + // Do not switch to output window when clangd returns output. revealOutputChannelOn: vscodelc.RevealOutputChannelOn.Never, // We hack up the completion items a bit to prevent VSCode from re-ranking them @@ -126,7 +126,7 @@ provideCompletionItem: async (document, position, context, token, next) => { let list = await next(document, position, context, token); let items = (Array.isArray(list) ? list : list.items).map(item => { - // Gets the prefix used by vscode when doing fuzzymatch. + // Gets the prefix used by VSCode when doing fuzzymatch. let prefix = document.getText(new vscode.Range(item.range.start, position)) if (prefix) item.filterText = prefix + "_" + item.filterText; diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/tsconfig.json b/clang-tools-extra/clangd/clients/clangd-vscode/tsconfig.json --- a/clang-tools-extra/clangd/clients/clangd-vscode/tsconfig.json +++ b/clang-tools-extra/clangd/clients/clangd-vscode/tsconfig.json @@ -26,4 +26,4 @@ "node_modules", ".vscode-test" ] -} \ No newline at end of file +}