forked from OSchip/llvm-project
[clangd][vscode] Add a flag to enable semantic highlighting in clangd
Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67096 llvm-svn: 371038
This commit is contained in:
parent
8db9e0e697
commit
32048464ee
|
@ -89,6 +89,11 @@
|
||||||
"clangd.trace": {
|
"clangd.trace": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Names a file that clangd should log a performance trace to, in chrome trace-viewer JSON format."
|
"description": "Names a file that clangd should log a performance trace to, in chrome trace-viewer JSON format."
|
||||||
|
},
|
||||||
|
"clangd.semanticHighlighting": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": "false",
|
||||||
|
"description": "Enable semantic highlighting in clangd"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -109,12 +109,14 @@ export function activate(context: vscode.ExtensionContext) {
|
||||||
|
|
||||||
const clangdClient = new ClangdLanguageClient('Clang Language Server',
|
const clangdClient = new ClangdLanguageClient('Clang Language Server',
|
||||||
serverOptions, clientOptions);
|
serverOptions, clientOptions);
|
||||||
const semanticHighlightingFeature =
|
if (getConfig<boolean>('semanticHighlighting')) {
|
||||||
|
const semanticHighlightingFeature =
|
||||||
new semanticHighlighting.SemanticHighlightingFeature(clangdClient,
|
new semanticHighlighting.SemanticHighlightingFeature(clangdClient,
|
||||||
context);
|
context);
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
vscode.Disposable.from(semanticHighlightingFeature));
|
vscode.Disposable.from(semanticHighlightingFeature));
|
||||||
clangdClient.registerFeature(semanticHighlightingFeature);
|
clangdClient.registerFeature(semanticHighlightingFeature);
|
||||||
|
}
|
||||||
console.log('Clang Language Server is now active!');
|
console.log('Clang Language Server is now active!');
|
||||||
context.subscriptions.push(clangdClient.start());
|
context.subscriptions.push(clangdClient.start());
|
||||||
context.subscriptions.push(vscode.commands.registerCommand(
|
context.subscriptions.push(vscode.commands.registerCommand(
|
||||||
|
|
Loading…
Reference in New Issue