forked from OSchip/llvm-project
[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
This commit is contained in:
parent
2effe8f5e7
commit
db3d64eebb
|
@ -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": [
|
||||
|
|
|
@ -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"
|
||||
}
|
|
@ -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@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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue