[clang-tools-extra] db3d64e - [clangd-vscode] NFC; Improve wording in documentation and update VSCode tasks

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 05:17:21 PDT 2020


Author: Kirill Bobyrev
Date: 2020-04-01T14:16:55+02:00
New Revision: db3d64eebbe0aad87631c6fada01b06753377a44

URL: https://github.com/llvm/llvm-project/commit/db3d64eebbe0aad87631c6fada01b06753377a44
DIFF: https://github.com/llvm/llvm-project/commit/db3d64eebbe0aad87631c6fada01b06753377a44.diff

LOG: [clangd-vscode] NFC; Improve wording in documentation and update VSCode tasks

Summary:
VSCode tasks are updated to the latest supported versions: deprecated
values are removed and replaced by their new counterparts.

Reviewers: hokein

Reviewed By: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76595

Added: 
    

Modified: 
    clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json
    clang-tools-extra/clangd/clients/clangd-vscode/.vscode/tasks.json
    clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md
    clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
    clang-tools-extra/clangd/clients/clangd-vscode/tsconfig.json

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json b/clang-tools-extra/clangd/clients/clangd-vscode/.vscode/launch.json
index cd6b87bd05c0..7d414bc00f32 100644
--- 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
index fb7f662e14d1..65b1c9598c0e 100644
--- 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
index e888aba3ea20..15f2b930329e 100644
--- a/clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md
+++ b/clang-tools-extra/clangd/clients/clangd-vscode/DEVELOPING.md
@@ -10,20 +10,20 @@ A guide of developing `vscode-clangd` extension.
 ## 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 <F5>.
+   # When VSCode starts, press <F5>.
 ```
 
 # 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 @@ to the marketplace.
 * 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 at lists.llvm.org.
+maintained by clangd developers. If you want to make a new release, please
+contact clangd-dev at 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
index 4749cd1bb582..a7570b63e552 100644
--- 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 vscodelc from 'vscode-languageclient';
 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 @@ class EnableEditsNearCursorFeature implements vscodelc.StaticFeature {
 }
 
 /**
- *  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<boolean>('syncFileEvents', true);
@@ -97,7 +97,7 @@ export function activate(context: vscode.ExtensionContext) {
         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 @@ export function activate(context: vscode.ExtensionContext) {
         // 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 @@ export function activate(context: vscode.ExtensionContext) {
           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
index 0b05f3090920..71a62c71da02 100644
--- 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
+}


        


More information about the cfe-commits mailing list