diff --git a/README-dev.md b/README-dev.md index 8209d0d..587d01b 100644 --- a/README-dev.md +++ b/README-dev.md @@ -1,8 +1,10 @@ -# cquery +# ccls -This is the Visual Studio Code extension for cquery. The main cquery language -server which powers this extension is found at -[https://github.com/cquery-project/cquery](https://github.com/cquery-project/cquery). +This is the Visual Studio Code extension for ccls, which is a rewrite of cquery. +This repository is just a rename of vscode-cquery. + +The main ccls language server which powers this extension is found at +[https://github.com/cquery-project/ccls](https://github.com/cquery-project/cquery). # Building @@ -17,7 +19,7 @@ npm install python build.py ``` -Now, you can use vscode to install `out/cquery.vsix`. +Now, you can use vscode to install `out/ccls.vsix`. # Deploying diff --git a/README.md b/README.md index 70023e5..cac696d 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,5 @@ -# cquery +# vscode-ccls -[cquery](https://github.com/cquery-project/cquery) provides extremely fast, -robust, and reliable C++ integration into vscode with a ton of features, like -code lens, references, code completion, semantic highlighting, and much more. +This is the Visual Studio Code extension for [ccls](https://github.com/MaskRay/ccls), which is a rewrite of [cquery](https://github.com/cquery-project/cquery). -You currently need to install and build the main cquery server (eventually this -will be downloaded for you from prebuilts). See the [Getting -Started](https://github.com/cquery-project/cquery/wiki/Getting-started) wiki -entry. - -This extension is still in preview. Please see additional documentation at the -main cquery -[wiki](https://github.com/cquery-project/cquery/wiki/Visual-Studio-Code). - -# LICENSE - -MIT +See [Getting started](https://github.com/MaskRay/ccls/wiki/Getting-started) diff --git a/build.py b/build.py index 1a91be7..29c9136 100755 --- a/build.py +++ b/build.py @@ -5,7 +5,7 @@ from os.path import join if __name__ == "__main__": - OUT = 'out/cquery.vsix' + OUT = 'out/ccls.vsix' VSCE = 'vsce.cmd' if sys.platform == 'win32' else 'vsce' VSCE = join('node_modules', '.bin', VSCE) sys.exit(subprocess.call([VSCE, 'package', '-o', OUT])) diff --git a/package-lock.json b/package-lock.json index 0457809..42007d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "cquery", + "name": "ccls", "version": "0.1.10", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index 1251032..80258c7 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "cquery", + "name": "ccls", "description": "Low-latency language server for C++. Highly scalable and designed for huge code bases.", - "author": "cquery-project", + "author": "ccls-project", "license": "MIT", "version": "0.1.10", - "publisher": "cquery-project", + "publisher": "ccls-project", "preview": true, "engines": { "vscode": "^1.22.0" @@ -17,7 +17,7 @@ "onLanguage:cpp", "onLanguage:objective-c", "onLanguage:objective-cpp", - "workspaceContains:.cquery", + "workspaceContains:.ccls", "workspaceContains:compile_commands.json", "workspaceContains:build/compile_commands.json" ], @@ -26,69 +26,69 @@ "views": { "explorer": [ { - "id": "cquery.inheritanceHierarchy", + "id": "ccls.inheritanceHierarchy", "name": "Inheritance Hierarchy", - "when": "extension.cquery.inheritanceHierarchyVisible" + "when": "extension.ccls.inheritanceHierarchyVisible" }, { - "id": "cquery.callHierarchy", + "id": "ccls.callHierarchy", "name": "Call Hierarchy", - "when": "extension.cquery.callHierarchyVisible" + "when": "extension.ccls.callHierarchyVisible" } ] }, "menus": { "editor/context": [ { - "command": "cquery.inheritanceHierarchy", + "command": "ccls.inheritanceHierarchy", "when": "resourceLangId == cpp", "group": "navigation@1.31" }, { - "command": "cquery.callHierarchy", + "command": "ccls.callHierarchy", "when": "resourceLangId == cpp", "group": "navigation@1.32" }, { - "command": "cquery.vars", + "command": "ccls.vars", "when": "resourceLangId == cpp", "group": "navigation@1.33" }, { - "command": "cquery.base", + "command": "ccls.base", "when": "resourceLangId == cpp", "group": "navigation@1.34" } ], "view/title": [ { - "command": "cquery.closeInheritanceHierarchy", - "when": "view == cquery.inheritanceHierarchy", + "command": "ccls.closeInheritanceHierarchy", + "when": "view == ccls.inheritanceHierarchy", "group": "navigation" }, { - "command": "cquery.closeCallHierarchy", - "when": "view == cquery.callHierarchy", + "command": "ccls.closeCallHierarchy", + "when": "view == ccls.callHierarchy", "group": "navigation" } ], "view/item/context": [ { - "command": "cquery.gotoForTreeView", - "when": "viewItem == cqueryGoto" + "command": "ccls.gotoForTreeView", + "when": "viewItem == cclsGoto" } ], "commandPalette": [ { - "command": "cquery.closeInheritanceHierarchy", + "command": "ccls.closeInheritanceHierarchy", "when": "false" }, { - "command": "cquery.closeCallHierarchy", + "command": "ccls.closeCallHierarchy", "when": "false" }, { - "command": "cquery.gotoForTreeView", + "command": "ccls.gotoForTreeView", "when": "false" } ] @@ -96,158 +96,158 @@ "commands": [ { "title": "Freshen Index", - "category": "cquery", - "command": "cquery.freshenIndex" + "category": "ccls", + "command": "ccls.freshenIndex" }, { "title": "Inheritance Hierarchy", - "category": "cquery", - "command": "cquery.inheritanceHierarchy" + "category": "ccls", + "command": "ccls.inheritanceHierarchy" }, { "title": "Close", - "command": "cquery.closeInheritanceHierarchy" + "command": "ccls.closeInheritanceHierarchy" }, { "title": "Call Hierarchy", - "category": "cquery", - "command": "cquery.callHierarchy" + "category": "ccls", + "command": "ccls.callHierarchy" }, { "title": "Close", - "command": "cquery.closeCallHierarchy" + "command": "ccls.closeCallHierarchy" }, { "title": "Show Variables", - "category": "cquery", - "command": "cquery.vars" + "category": "ccls", + "command": "ccls.vars" }, { "title": "Show Callers", - "category": "cquery", - "command": "cquery.callers" + "category": "ccls", + "command": "ccls.callers" }, { "title": "Show Base", - "category": "cquery", - "command": "cquery.base" + "category": "ccls", + "command": "ccls.base" }, { "title": "Go to Tree View Entry", - "category": "cquery", - "command": "cquery.gotoForTreeView" + "category": "ccls", + "command": "ccls.gotoForTreeView" } ], "configuration": { "type": "object", - "title": "cquery", + "title": "ccls", "properties": { - "cquery.launch.command": { + "ccls.launch.command": { "type": "string", - "default": "cquery", - "description": "Path to the cquery binary (default assumes the binary is in the PATH)" + "default": "ccls", + "description": "Path to the ccls binary (default assumes the binary is in the PATH)" }, - "cquery.launch.args": { + "ccls.launch.args": { "type": "array", "default": [], - "description": "Array containing extra arguments to pass to the cquery binary" + "description": "Array containing extra arguments to pass to the ccls binary" }, - "cquery.launch.autoRestart": { + "ccls.launch.autoRestart": { "type": "boolean", "default": true, - "description": "If true, cquery will be automatically restarted if it crashes." + "description": "If true, ccls will be automatically restarted if it crashes." }, - "cquery.launch.notifyOnCrash": { + "ccls.launch.notifyOnCrash": { "type": "boolean", "default": false, - "description": "If true, a notification message will be displayed whenever cquery crashes." + "description": "If true, a notification message will be displayed whenever ccls crashes." }, - "cquery.cacheDirectory": { + "ccls.cacheDirectory": { "type": "string", "default": "", - "description": "Absolute path to the directory that the cached index will be stored in. Try to have this directory on an SSD. If not explicitly set, this will be automatically populated with the extension cache directory.\n\n${workspaceFolder} will be replaced by the folder where .vscode/settings.json resides.\n\nCache directories are project-wide, so this should be configured in the workspace settings so multiple indexes do not clash.\n\nExample value: \"/work/cquery-cache/chrome/\"" + "description": "Absolute path to the directory that the cached index will be stored in. Try to have this directory on an SSD. If not explicitly set, this will be automatically populated with the extension cache directory.\n\n${workspaceFolder} will be replaced by the folder where .vscode/settings.json resides.\n\nCache directories are project-wide, so this should be configured in the workspace settings so multiple indexes do not clash.\n\nExample value: \"/work/ccls-cache/chrome/\"" }, - "cquery.developer.emitQueryDbBlocked": { + "ccls.developer.emitQueryDbBlocked": { "type": "boolean", "default": false, "description": "If true, a notification will be shown whenever the querydb thread is busy." }, - "cquery.highlighting.enabled.types": { + "ccls.highlighting.enabled.types": { "type": "boolean", "default": false, "description": "If semantic highlighting for classes, structs, and unions is enabled/disabled." }, - "cquery.highlighting.enabled.freeStandingFunctions": { + "ccls.highlighting.enabled.freeStandingFunctions": { "type": "boolean", "default": false, "description": "If semantic highlighting for member functions is enabled/disabled." }, - "cquery.highlighting.enabled.memberFunctions": { + "ccls.highlighting.enabled.memberFunctions": { "type": "boolean", "default": false, "description": "If semantic highlighting for member functions is enabled/disabled." }, - "cquery.highlighting.enabled.freeStandingVariables": { + "ccls.highlighting.enabled.freeStandingVariables": { "type": "boolean", "default": false, "description": "If semantic highlighting for member free-standing variables is enabled/disabled." }, - "cquery.highlighting.enabled.memberVariables": { + "ccls.highlighting.enabled.memberVariables": { "type": "boolean", "default": false, "description": "If semantic highlighting for member variables is enabled/disabled." }, - "cquery.highlighting.enabled.namespaces": { + "ccls.highlighting.enabled.namespaces": { "type": "boolean", "default": false, "description": "If semantic highlighting for namespaces is enabled/disabled." }, - "cquery.highlighting.enabled.macros": { + "ccls.highlighting.enabled.macros": { "type": "boolean", "default": false, "description": "If semantic highlighting for macros is enabled/disabled." }, - "cquery.highlighting.enabled.enums": { + "ccls.highlighting.enabled.enums": { "type": "boolean", "default": false, "description": "If semantic highlighting for enumerations is enabled/disabled." }, - "cquery.highlighting.enabled.typeAliases": { + "ccls.highlighting.enabled.typeAliases": { "type": "boolean", "default": false, "description": "If semantic highlighting for type aliases is enabled/disabled." }, - "cquery.highlighting.enabled.enumConstants": { + "ccls.highlighting.enabled.enumConstants": { "type": "boolean", "default": false, "description": "If semantic highlighting for enumerators is enabled/disabled." }, - "cquery.highlighting.enabled.staticMemberFunctions": { + "ccls.highlighting.enabled.staticMemberFunctions": { "type": "boolean", "default": false, "description": "If semantic highlighting for static member functions is enabled/disabled." }, - "cquery.highlighting.enabled.parameters": { + "ccls.highlighting.enabled.parameters": { "type": "boolean", "default": false, "description": "If semantic highlighting for parameters is enabled/disabled." }, - "cquery.highlighting.enabled.templateParameters": { + "ccls.highlighting.enabled.templateParameters": { "type": "boolean", "default": false, "description": "If semantic highlighting for template parameters is enabled/disabled." }, - "cquery.highlighting.enabled.staticMemberVariables": { + "ccls.highlighting.enabled.staticMemberVariables": { "type": "boolean", "default": false, "description": "If semantic highlighting for static member variables is enabled/disabled." }, - "cquery.highlighting.enabled.globalVariables": { + "ccls.highlighting.enabled.globalVariables": { "type": "boolean", "default": false, "description": "If semantic highlighting for global variables is enabled/disabled." }, - "cquery.highlighting.colors.types": { + "ccls.highlighting.colors.types": { "type": "array", "default": [ "#e1afc3", @@ -263,7 +263,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.freeStandingFunctions": { + "ccls.highlighting.colors.freeStandingFunctions": { "type": "array", "default": [ "#e5b124", @@ -279,7 +279,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.memberFunctions": { + "ccls.highlighting.colors.memberFunctions": { "type": "array", "default": [ "#e5b124", @@ -295,7 +295,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.freeStandingVariables": { + "ccls.highlighting.colors.freeStandingVariables": { "type": "array", "default": [ "#587d87", @@ -311,7 +311,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.memberVariables": { + "ccls.highlighting.colors.memberVariables": { "type": "array", "default": [ "#587d87", @@ -327,7 +327,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.namespaces": { + "ccls.highlighting.colors.namespaces": { "type": "array", "default": [ "#429921", @@ -343,7 +343,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.macros": { + "ccls.highlighting.colors.macros": { "type": "array", "default": [ "#e79528", @@ -359,7 +359,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.enums": { + "ccls.highlighting.colors.enums": { "type": "array", "default": [ "#e1afc3", @@ -375,7 +375,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.typeAliases": { + "ccls.highlighting.colors.typeAliases": { "type": "array", "default": [ "#e1afc3", @@ -391,7 +391,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.staticMemberFunctions": { + "ccls.highlighting.colors.staticMemberFunctions": { "type": "array", "default": [ "#e5b124", @@ -407,7 +407,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.enumConstants": { + "ccls.highlighting.colors.enumConstants": { "type": "array", "default": [ "#587d87", @@ -423,7 +423,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.parameters": { + "ccls.highlighting.colors.parameters": { "type": "array", "default": [ "#587d87", @@ -439,7 +439,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.templateParameters": { + "ccls.highlighting.colors.templateParameters": { "type": "array", "default": [ "#e1afc3", @@ -455,7 +455,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.staticMemberVariables": { + "ccls.highlighting.colors.staticMemberVariables": { "type": "array", "default": [ "#587d87", @@ -471,7 +471,7 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.colors.globalVariables": { + "ccls.highlighting.colors.globalVariables": { "type": "array", "default": [ "#587d87", @@ -487,207 +487,207 @@ ], "description": "Colors to use for semantic highlighting. A good generator is http://tools.medialab.sciences-po.fr/iwanthue/. If multiple colors are specified, semantic highlighting will cycle through them for successive symbols." }, - "cquery.highlighting.underline.types": { + "ccls.highlighting.underline.types": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.freeStandingFunctions": { + "ccls.highlighting.underline.freeStandingFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.memberFunctions": { + "ccls.highlighting.underline.memberFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.freeStandingVariables": { + "ccls.highlighting.underline.freeStandingVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.memberVariables": { + "ccls.highlighting.underline.memberVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.namespaces": { + "ccls.highlighting.underline.namespaces": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.macros": { + "ccls.highlighting.underline.macros": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.enums": { + "ccls.highlighting.underline.enums": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.typeAliases": { + "ccls.highlighting.underline.typeAliases": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.enumConstants": { + "ccls.highlighting.underline.enumConstants": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.staticMemberFunctions": { + "ccls.highlighting.underline.staticMemberFunctions": { "type": "boolean", "default": true }, - "cquery.highlighting.underline.parameters": { + "ccls.highlighting.underline.parameters": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.templateParameters": { + "ccls.highlighting.underline.templateParameters": { "type": "boolean", "default": false }, - "cquery.highlighting.underline.staticMemberVariables": { + "ccls.highlighting.underline.staticMemberVariables": { "type": "boolean", "default": true }, - "cquery.highlighting.underline.globalVariables": { + "ccls.highlighting.underline.globalVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.types": { + "ccls.highlighting.italic.types": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.freeStandingFunctions": { + "ccls.highlighting.italic.freeStandingFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.memberFunctions": { + "ccls.highlighting.italic.memberFunctions": { "type": "boolean", "default": true }, - "cquery.highlighting.italic.freeStandingVariables": { + "ccls.highlighting.italic.freeStandingVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.memberVariables": { + "ccls.highlighting.italic.memberVariables": { "type": "boolean", "default": true }, - "cquery.highlighting.italic.namespaces": { + "ccls.highlighting.italic.namespaces": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.macros": { + "ccls.highlighting.italic.macros": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.enums": { + "ccls.highlighting.italic.enums": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.typeAliases": { + "ccls.highlighting.italic.typeAliases": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.enumConstants": { + "ccls.highlighting.italic.enumConstants": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.staticMemberFunctions": { + "ccls.highlighting.italic.staticMemberFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.parameters": { + "ccls.highlighting.italic.parameters": { "type": "boolean", "default": true }, - "cquery.highlighting.italic.templateParameters": { + "ccls.highlighting.italic.templateParameters": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.staticMemberVariables": { + "ccls.highlighting.italic.staticMemberVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.italic.globalVariables": { + "ccls.highlighting.italic.globalVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.types": { + "ccls.highlighting.bold.types": { "type": "boolean", "default": true }, - "cquery.highlighting.bold.freeStandingFunctions": { + "ccls.highlighting.bold.freeStandingFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.memberFunctions": { + "ccls.highlighting.bold.memberFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.freeStandingVariables": { + "ccls.highlighting.bold.freeStandingVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.memberVariables": { + "ccls.highlighting.bold.memberVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.namespaces": { + "ccls.highlighting.bold.namespaces": { "type": "boolean", "default": true }, - "cquery.highlighting.bold.macros": { + "ccls.highlighting.bold.macros": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.enums": { + "ccls.highlighting.bold.enums": { "type": "boolean", "default": true }, - "cquery.highlighting.bold.typeAliases": { + "ccls.highlighting.bold.typeAliases": { "type": "boolean", "default": true }, - "cquery.highlighting.bold.enumConstants": { + "ccls.highlighting.bold.enumConstants": { "type": "boolean", "default": true }, - "cquery.highlighting.bold.staticMemberFunctions": { + "ccls.highlighting.bold.staticMemberFunctions": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.parameters": { + "ccls.highlighting.bold.parameters": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.templateParameters": { + "ccls.highlighting.bold.templateParameters": { "type": "boolean", "default": true }, - "cquery.highlighting.bold.staticMemberVariables": { + "ccls.highlighting.bold.staticMemberVariables": { "type": "boolean", "default": false }, - "cquery.highlighting.bold.globalVariables": { + "ccls.highlighting.bold.globalVariables": { "type": "boolean", "default": false }, - "cquery.index.extraClangArguments": { + "ccls.index.extraClangArguments": { "type": "array", "default": [], "description": "An extra set of command line arguments to give clang when indexing. Each list entry is a separate argument." }, - "cquery.index.whitelist": { + "ccls.index.whitelist": { "type": "array", "default": [], - "description": "If a translation unit's absolute path matches any EMCAScript regex in this list, it will be indexed. The whitelist takes priority over the blacklist. To only index files in the whitelist, make \"cquery.index.blacklist\" match everything, ie, set it to \".*\".\n\nYou probably want to begin the regex using \".*\" because the passed paths are absolute." + "description": "If a translation unit's absolute path matches any EMCAScript regex in this list, it will be indexed. The whitelist takes priority over the blacklist. To only index files in the whitelist, make \"ccls.index.blacklist\" match everything, ie, set it to \".*\".\n\nYou probably want to begin the regex using \".*\" because the passed paths are absolute." }, - "cquery.index.blacklist": { + "ccls.index.blacklist": { "type": "array", "default": [], "description": "A translation unit (cc/cpp file) is not indexed if any of the EMCAScript regexes in this list matches translation unit's the absolute path.\n\nYou probably want to begin the regex using \".*\" because the passed paths are absolute." }, - "cquery.log.skippedPathsForIndex": { + "ccls.log.skippedPathsForIndex": { "type": "boolean", "default": false, - "description": "If true, paths which were skipped by `cquery.index.whitelist` and `cquery.index.blacklist` will be logged and viewable in the cquery output window." + "description": "If true, paths which were skipped by `ccls.index.whitelist` and `ccls.index.blacklist` will be logged and viewable in the ccls output window." }, - "cquery.misc.status": { + "ccls.misc.status": { "type": "string", "default": "short", "enum": [ @@ -697,60 +697,60 @@ ], "description": "Controls the visibility of the status indicator." }, - "cquery.misc.resourceDirectory": { + "ccls.misc.resourceDirectory": { "type": "string", "default": "", - "description": "Default value to use for clang -resource-dir argument. This will be automatically supplied by cquery if not provided." + "description": "Default value to use for clang -resource-dir argument. This will be automatically supplied by ccls if not provided." }, - "cquery.misc.maxWorkspaceSearchResults": { + "ccls.misc.maxWorkspaceSearchResults": { "type": [ "number", "null" ], "default": null, - "description": "The maximum number of global search (ie, Ctrl+P + #foo) search results to report. For small search strings on large projects there can be a massive number of results (ie, over 1,000,000) so this limit is important to avoid extremely long delays. null means use the default value provided by the cquery language server." + "description": "The maximum number of global search (ie, Ctrl+P + #foo) search results to report. For small search strings on large projects there can be a massive number of results (ie, over 1,000,000) so this limit is important to avoid extremely long delays. null means use the default value provided by the ccls language server." }, - "cquery.misc.indexerCount": { + "ccls.misc.indexerCount": { "type": "number", "default": 0, - "description": "Forcibly set the number of indexing/working jobs. This value is automatically computed by the indexer and you should not need to set it manually.\n\nIdeally, this should be the number of CPU cores you have, minus one. cquery scales quite well so this number can go very high; cquery will use 5000%+ CPU usage on machines with over 50 cores. If you set the value higher than your number of hardware threads, cquery will slow down significantly due to thread contention.\n\nIf set to 0 or a negative value, the indexer will ignore this value.\n\nFor example, if you have a 4 core hyper-threaded processor, this should be set to 7. If you have dual 13 core hyper-threaded processors, this should be set to 2*13*2-1=51." + "description": "Forcibly set the number of indexing/working jobs. This value is automatically computed by the indexer and you should not need to set it manually.\n\nIdeally, this should be the number of CPU cores you have, minus one. ccls scales quite well so this number can go very high; ccls will use 5000%+ CPU usage on machines with over 50 cores. If you set the value higher than your number of hardware threads, ccls will slow down significantly due to thread contention.\n\nIf set to 0 or a negative value, the indexer will ignore this value.\n\nFor example, if you have a 4 core hyper-threaded processor, this should be set to 7. If you have dual 13 core hyper-threaded processors, this should be set to 2*13*2-1=51." }, - "cquery.misc.enableIndexing": { + "ccls.misc.enableIndexing": { "type": "boolean", "default": true, "description": "If set to false, updating the index will be disabled. You should not need to use this." }, - "cquery.misc.enableCacheWrite": { + "ccls.misc.enableCacheWrite": { "type": "boolean", "default": true, "description": "If set to false, writing indexed files out to cache will be disabled. Only useful if |enableIndexing| is true. You should not need to use this." }, - "cquery.misc.enableCacheRead": { + "ccls.misc.enableCacheRead": { "type": "boolean", "default": true, "description": "If set to false, restoring the cached index will be disabled. Only useful if there is a cached index stored on disk. You should not need to use this." }, - "cquery.misc.compilationDatabaseDirectory": { + "ccls.misc.compilationDatabaseDirectory": { "type": "string", "default": "", "description": "If not empty, the compilation database directory to use instead of the project root" }, - "cquery.misc.showInactiveRegions": { + "ccls.misc.showInactiveRegions": { "type": "boolean", "default": true, - "description": "If true, cquery will highlight inactive regions." + "description": "If true, ccls will highlight inactive regions." }, - "cquery.misc.discoverSystemIncludes": { + "ccls.misc.discoverSystemIncludes": { "type": "boolean", "default": true, - "description": "If true, cquery will detect system includes using clang -E." + "description": "If true, ccls will detect system includes using clang -E." }, - "cquery.completion.include.maximumPathLength": { + "ccls.completion.include.maximumPathLength": { "type": "integer", "default": 37, "description": "Maximum length for path in #include proposals. If the path length goes beyond this number it will be elided. Set to 0 to always display the full path." }, - "cquery.completion.include.whitelistLiteralEnding": { + "ccls.completion.include.whitelistLiteralEnding": { "type": "array", "default": [ ".h", @@ -759,82 +759,82 @@ ], "description": "Only files ending in one of these values will be shown in include auto-complete. Set to the empty-list to disable include auto-complete." }, - "cquery.completion.include.whitelist": { + "ccls.completion.include.whitelist": { "type": "array", "default": [], "description": "EMCAScript regex that checks absolute file path. If it does not match, the file is not added to include path auto-complete. An example is \".*/src/.*\"" }, - "cquery.completion.include.blacklist": { + "ccls.completion.include.blacklist": { "type": "array", "default": [], "description": "EMCAScript regex that checks absolute path. If it matches, the file is not added to include path auto-complete. An example is \".*/CACHE/.*\"" }, - "cquery.showDocumentLinksOnIncludes": { + "ccls.showDocumentLinksOnIncludes": { "type": "boolean", "default": true, "description": "If true, document links (an underline) will be rendered on includes. Goto definition (control click) will still work on includes even if this is false." }, - "cquery.diagnostics.blacklist": { + "ccls.diagnostics.blacklist": { "type": "array", "default": [], "description": "Files that match these patterns won't be displayed in diagnostics view." }, - "cquery.diagnostics.whitelist": { + "ccls.diagnostics.whitelist": { "type": "array", "default": [], "description": "Files that match these patterns will be displayed in diagnostics view." }, - "cquery.diagnostics.onParse": { + "ccls.diagnostics.onParse": { "type": "boolean", "default": true, "description": "If true, diagnostics will be reported when a file is parsed (ie, saving or indexed)." }, - "cquery.diagnostics.onType": { + "ccls.diagnostics.onType": { "type": "boolean", "default": true, "description": "If true, code completion will trigger diagnostic updates." }, - "cquery.codeLens.renderInline": { + "ccls.codeLens.renderInline": { "type": "boolean", "default": false, "description": "Enables a custom code lens renderer so code lens are displayed inline with code. This removes any vertical-space footprint at the cost of horizontal space." }, - "cquery.codeLens.onLocalVariables": { + "ccls.codeLens.onLocalVariables": { "type": "boolean", "default": false, "description": "Set to false to hide code lens on parameters and function local variables." }, - "cquery.treeViews.doubleClickTimeoutMs": { + "ccls.treeViews.doubleClickTimeoutMs": { "type": "number", "default": 500, "description": "If a tree view entry is double-clicked within this timeout value, vscode will navigate to the entry." }, - "cquery.theme.light.inactiveRegion.textColor": { + "ccls.theme.light.inactiveRegion.textColor": { "type": "string", "default": "rgb(100, 100, 100)", "description": "css styling to apply to text when the code region has been disabled by the preprocessor in a light theme." }, - "cquery.theme.light.inactiveRegion.backgroundColor": { + "ccls.theme.light.inactiveRegion.backgroundColor": { "type": "string", "default": "rgba(220, 220, 220, 0.3)", "description": "css styling to apply to the background when the code region has been disabled by the preprocessor in a light theme." }, - "cquery.theme.dark.inactiveRegion.textColor": { + "ccls.theme.dark.inactiveRegion.textColor": { "type": "string", "default": "rgb(100, 100, 100)", "description": "css styling to apply to text when the code region has been disabled by the preprocessor in a dark theme." }, - "cquery.theme.dark.inactiveRegion.backgroundColor": { + "ccls.theme.dark.inactiveRegion.backgroundColor": { "type": "string", "default": "rgba(18, 18, 18, 0.3)", "description": "css styling to apply to the background when the code region has been disabled by the preprocessor in a dark theme." }, - "cquery.completion.enableSnippetInsertion": { + "ccls.completion.enableSnippetInsertion": { "type": "boolean", "default": true, "description": "If true, parameter declarations are inserted as snippets in function/method call arguments when completing a function/method call" }, - "cquery.formatting.enabled": { + "ccls.formatting.enabled": { "type": "boolean", "default": true, "description": "If document formatting is enabled/disabled" @@ -859,6 +859,6 @@ }, "repository": { "type": "git", - "url": "https://github.com/cquery-project/vscode-cquery.git" + "url": "https://github.com/MaskRay/vscode-ccls.git" } } diff --git a/src/callHierarchy.ts b/src/callHierarchy.ts index cc66067..1ca64e5 100644 --- a/src/callHierarchy.ts +++ b/src/callHierarchy.ts @@ -62,9 +62,9 @@ export class CallHierarchyProvider implements TreeDataProvider 0] }, @@ -81,7 +81,7 @@ export class CallHierarchyProvider implements TreeDataProvider) {} + readonly storage: StorageClass, readonly lsRanges: Array) {} } function getClientConfig(context: ExtensionContext) { @@ -81,21 +81,21 @@ function getClientConfig(context: ExtensionContext) { function hasAnySemanticHighlighting() { let options = [ - 'cquery.highlighting.enabled.types', - 'cquery.highlighting.enabled.freeStandingFunctions', - 'cquery.highlighting.enabled.memberFunctions', - 'cquery.highlighting.enabled.freeStandingVariables', - 'cquery.highlighting.enabled.memberVariables', - 'cquery.highlighting.enabled.namespaces', - 'cquery.highlighting.enabled.macros', - 'cquery.highlighting.enabled.enums', - 'cquery.highlighting.enabled.typeAliases', - 'cquery.highlighting.enabled.enumConstants', - 'cquery.highlighting.enabled.staticMemberFunctions', - 'cquery.highlighting.enabled.parameters', - 'cquery.highlighting.enabled.templateParameters', - 'cquery.highlighting.enabled.staticMemberVariables', - 'cquery.highlighting.enabled.globalVariables']; + 'ccls.highlighting.enabled.types', + 'ccls.highlighting.enabled.freeStandingFunctions', + 'ccls.highlighting.enabled.memberFunctions', + 'ccls.highlighting.enabled.freeStandingVariables', + 'ccls.highlighting.enabled.memberVariables', + 'ccls.highlighting.enabled.namespaces', + 'ccls.highlighting.enabled.macros', + 'ccls.highlighting.enabled.enums', + 'ccls.highlighting.enabled.typeAliases', + 'ccls.highlighting.enabled.enumConstants', + 'ccls.highlighting.enabled.staticMemberFunctions', + 'ccls.highlighting.enabled.parameters', + 'ccls.highlighting.enabled.templateParameters', + 'ccls.highlighting.enabled.staticMemberVariables', + 'ccls.highlighting.enabled.globalVariables']; let config = workspace.getConfiguration(); for (let name of options) { if (config.get(name, false)) @@ -104,7 +104,7 @@ function getClientConfig(context: ExtensionContext) { return false; } - // Read prefs; this map goes from `cquery/js name` => `vscode prefs name`. + // Read prefs; this map goes from `ccls/js name` => `vscode prefs name`. let configMapping = [ ['launchCommand', 'launch.command'], ['launchArgs', 'launch.args'], @@ -140,13 +140,14 @@ function getClientConfig(context: ExtensionContext) { launchCommand: '', cacheDirectory: '', highlight: { - enabled: hasAnySemanticHighlighting() + lsRanges: true, + enabled: hasAnySemanticHighlighting(), }, workspaceSymbol: { sort: false, }, }; - let config = workspace.getConfiguration('cquery'); + let config = workspace.getConfiguration('ccls'); for (let prop of configMapping) { let value = config.get(prop[1]); if (value != null) { @@ -169,7 +170,7 @@ function getClientConfig(context: ExtensionContext) { window .showErrorMessage( 'Could not auto-discover cache directory. Please use "Open Folder" ' + - 'or specify it in the |cquery.cacheDirectory| setting.', + 'or specify it in the |ccls.cacheDirectory| setting.', kOpenSettings) .then((selected) => { if (selected == kOpenSettings) @@ -181,7 +182,7 @@ function getClientConfig(context: ExtensionContext) { // Provide a default cache directory if it is not present. Insert next to // the project since if the user has an SSD they most likely have their // source files on the SSD as well. - let cacheDir = '${workspaceFolder}/.vscode/cquery_cached_index/'; + let cacheDir = '${workspaceFolder}/.vscode/ccls_cached_index/'; clientConfig.cacheDirectory = cacheDir; config.update(kCacheDirPrefName, cacheDir, false /*global*/); } @@ -203,7 +204,7 @@ export function activate(context: ExtensionContext) { let clientConfig = getClientConfig(context); if (!clientConfig) return; - // Notify the user that if they change a cquery setting they need to restart + // Notify the user that if they change a ccls setting they need to restart // vscode. context.subscriptions.push(workspace.onDidChangeConfiguration(() => { let newConfig = getClientConfig(context); @@ -215,7 +216,7 @@ export function activate(context: ExtensionContext) { JSON.stringify(clientConfig[key]) != JSON.stringify(newConfig[key])) { const kReload = 'Reload' - const message = `Please reload to apply the "cquery.${ + const message = `Please reload to apply the "ccls.${ key}" configuration change.`; window.showInformationMessage(message, kReload).then(selected => { @@ -227,7 +228,7 @@ export function activate(context: ExtensionContext) { } })); - let args = ['--language-server'].concat(clientConfig['launchArgs']); + let args = clientConfig['launchArgs']; let env: any = {}; let kToForward = [ @@ -294,7 +295,7 @@ export function activate(context: ExtensionContext) { function provideCodeLens( document: TextDocument, token: CancellationToken, next: ProvideCodeLensesSignature): ProviderResult { - let config = workspace.getConfiguration('cquery'); + let config = workspace.getConfiguration('ccls'); let enableInlineCodeLens = config.get('codeLens.renderInline', false); if (!enableInlineCodeLens) return next(document, token); @@ -318,11 +319,11 @@ export function activate(context: ExtensionContext) { let clientOptions: LanguageClientOptions = { documentSelector: ['c', 'cpp', 'objective-c', 'objective-cpp'], // synchronize: { - // configurationSection: 'cquery', + // configurationSection: 'ccls', // fileEvents: workspace.createFileSystemWatcher('**/.cc') // }, - diagnosticCollectionName: 'cquery', - outputChannelName: 'cquery', + diagnosticCollectionName: 'ccls', + outputChannelName: 'ccls', revealOutputChannelOn: RevealOutputChannelOn.Never, initializationOptions: clientConfig, middleware: {provideCodeLenses: provideCodeLens}, @@ -330,19 +331,19 @@ export function activate(context: ExtensionContext) { console.log(e); return false; }, - errorHandler: new CqueryErrorHandler(workspace.getConfiguration('cquery')) + errorHandler: new cclsErrorHandler(workspace.getConfiguration('ccls')) } // Create the language client and start the client. let languageClient = - new LanguageClient('cquery', 'cquery', serverOptions, clientOptions); + new LanguageClient('ccls', 'ccls', serverOptions, clientOptions); let command = serverOptions.command languageClient.onReady().catch(e => { - // TODO: remove cquery.launch.workingDirectory after July 2018 + // TODO: remove ccls.launch.workingDirectory after July 2018 window.showErrorMessage( - 'cquery.launch.command has changed; either add cquery to your PATH ' + - 'or make cquery.launch.command an absolute path. Current value: "' + - command + '". cquery.launch.workingDirectory has been removed.'); + 'ccls.launch.command has changed; either add ccls to your PATH ' + + 'or make ccls.launch.command an absolute path. Current value: "' + + command + '". ccls.launch.workingDirectory has been removed.'); }); context.subscriptions.push(languageClient.start()); @@ -353,8 +354,8 @@ export function activate(context: ExtensionContext) { // General commands. (() => { - commands.registerCommand('cquery.freshenIndex', () => { - languageClient.sendNotification('$cquery/freshenIndex'); + commands.registerCommand('ccls.freshenIndex', () => { + languageClient.sendNotification('$ccls/freshenIndex'); }); function makeRefHandler(methodName, autoGotoIfSingle = false) { @@ -372,7 +373,7 @@ export function activate(context: ExtensionContext) { if (autoGotoIfSingle && locations.length == 1) { let location = p2c.asLocation(locations[0]); commands.executeCommand( - 'cquery.goto', location.uri, location.range.start, []); + 'ccls.goto', location.uri, location.range.start, []); } else { commands.executeCommand( 'editor.action.showReferences', uri, position, @@ -381,18 +382,18 @@ export function activate(context: ExtensionContext) { }) } } - commands.registerCommand('cquery.vars', makeRefHandler('$cquery/vars')); + commands.registerCommand('ccls.vars', makeRefHandler('$ccls/vars')); commands.registerCommand( - 'cquery.callers', makeRefHandler('$cquery/callers')); + 'ccls.callers', makeRefHandler('$ccls/callers')); commands.registerCommand( - 'cquery.base', makeRefHandler('$cquery/base', true)); + 'ccls.base', makeRefHandler('$ccls/base', true)); })(); // The language client does not correctly deserialize arguments, so we have a // wrapper command that does it for us. (() => { commands.registerCommand( - 'cquery.showReferences', + 'ccls.showReferences', (uri: string, position: ls.Position, locations: ls.Location[]) => { commands.executeCommand( 'editor.action.showReferences', p2c.asUri(uri), @@ -401,7 +402,7 @@ export function activate(context: ExtensionContext) { commands.registerCommand( - 'cquery.goto', + 'ccls.goto', (uri: string, position: ls.Position, locations: ls.Location[]) => { jumpToUriAtPosition( p2c.asUri(uri), p2c.asPosition(position), @@ -411,7 +412,7 @@ export function activate(context: ExtensionContext) { // FixIt support (() => { - commands.registerCommand('cquery._applyFixIt', (uri, pTextEdits) => { + commands.registerCommand('ccls._applyFixIt', (uri, pTextEdits) => { const textEdits = p2c.asTextEdits(pTextEdits); function applyEdits(e: TextEditor) { @@ -446,20 +447,20 @@ export function activate(context: ExtensionContext) { // AutoImplement (() => { - commands.registerCommand('cquery._autoImplement', (uri, pTextEdits) => { - commands.executeCommand('cquery._applyFixIt', uri, pTextEdits) + commands.registerCommand('ccls._autoImplement', (uri, pTextEdits) => { + commands.executeCommand('ccls._applyFixIt', uri, pTextEdits) .then(() => { commands.executeCommand( - 'cquery.goto', uri, pTextEdits[0].range.start); + 'ccls.goto', uri, pTextEdits[0].range.start); }); }); })(); // Insert include. (() => { - commands.registerCommand('cquery._insertInclude', (uri, pTextEdits) => { + commands.registerCommand('ccls._insertInclude', (uri, pTextEdits) => { if (pTextEdits.length == 1) - commands.executeCommand('cquery._applyFixIt', uri, pTextEdits); + commands.executeCommand('ccls._applyFixIt', uri, pTextEdits); else { let items: Array = []; class MyQuickPick implements QuickPickItem { @@ -471,7 +472,7 @@ export function activate(context: ExtensionContext) { items.push(new MyQuickPick(edit.newText, '', edit)); } window.showQuickPick(items).then((selected: MyQuickPick) => { - commands.executeCommand('cquery._applyFixIt', uri, [selected.edit]); + commands.executeCommand('ccls._applyFixIt', uri, [selected.edit]); }); } }); @@ -479,28 +480,28 @@ export function activate(context: ExtensionContext) { // Inactive regions. (() => { - let config = workspace.getConfiguration('cquery'); - const inactiveRegionDecorationType = window.createTextEditorDecorationType({ + let config = workspace.getConfiguration('ccls'); + const skippedRangeDecorationType = window.createTextEditorDecorationType({ isWholeLine: true, light: { - color: config.get('theme.light.inactiveRegion.textColor'), + color: config.get('theme.light.skippedRange.textColor'), backgroundColor: - config.get('theme.light.inactiveRegion.backgroundColor'), + config.get('theme.light.skippedRange.backgroundColor'), }, dark: { - color: config.get('theme.dark.inactiveRegion.textColor'), + color: config.get('theme.dark.skippedRange.textColor'), backgroundColor: - config.get('theme.dark.inactiveRegion.backgroundColor'), + config.get('theme.dark.skippedRange.backgroundColor'), } }); languageClient.onReady().then(() => { - languageClient.onNotification('$cquery/setInactiveRegions', (args) => { + languageClient.onNotification('$ccls/setSkippedRanges', (args) => { let uri = args.uri; - let ranges: Range[] = args.inactiveRegions.map(p2c.asRange); + let ranges: Range[] = args.skippedRanges.map(p2c.asRange); for (const textEditor of window.visibleTextEditors) { if (textEditor.document.uri.toString() == uri) { window.activeTextEditor.setDecorations( - inactiveRegionDecorationType, ranges); + skippedRangeDecorationType, ranges); break; } } @@ -510,16 +511,16 @@ export function activate(context: ExtensionContext) { // Progress (() => { - let config = workspace.getConfiguration('cquery'); + let config = workspace.getConfiguration('ccls'); let statusStyle = config.get('misc.status'); if (statusStyle == 'short' || statusStyle == 'detailed') { let statusIcon = window.createStatusBarItem(StatusBarAlignment.Right); - statusIcon.text = 'cquery: loading'; + statusIcon.text = 'ccls: loading'; statusIcon.tooltip = - 'cquery is loading project metadata (ie, compile_commands.json)'; + 'ccls is loading project metadata (ie, compile_commands.json)'; statusIcon.show(); languageClient.onReady().then(() => { - languageClient.onNotification('$cquery/progress', (args) => { + languageClient.onNotification('$ccls/progress', (args) => { let indexRequestCount = args.indexRequestCount || 0; let doIdMapCount = args.doIdMapCount || 0; let loadPreviousIndexCount = args.loadPreviousIndexCount || 0; @@ -538,14 +539,14 @@ export function activate(context: ExtensionContext) { `activeThreads: ${activeThreads}`; if (total == 0 && statusStyle == 'short') { - statusIcon.text = 'cquery: idle'; + statusIcon.text = 'ccls: idle'; } else { - statusIcon.text = `cquery: ${indexRequestCount}|${total} jobs`; + statusIcon.text = `ccls: ${indexRequestCount}|${total} jobs`; if (statusStyle == 'detailed') { statusIcon.text += ` (${detailedJobString})` } } - statusIcon.tooltip = 'cquery jobs: ' + detailedJobString; + statusIcon.tooltip = 'ccls jobs: ' + detailedJobString; }); }); } @@ -561,7 +562,7 @@ export function activate(context: ExtensionContext) { var timeout: NodeJS.Timer var resolvePromise: any languageClient.onReady().then(() => { - languageClient.onNotification('$cquery/queryDbStatus', (args) => { + languageClient.onNotification('$ccls/queryDbStatus', (args) => { let isActive: boolean = args.isActive; if (isActive) { if (timeout) { @@ -592,15 +593,15 @@ export function activate(context: ExtensionContext) { const inheritanceHierarchyProvider = new InheritanceHierarchyProvider(languageClient); window.registerTreeDataProvider( - 'cquery.inheritanceHierarchy', inheritanceHierarchyProvider); + 'ccls.inheritanceHierarchy', inheritanceHierarchyProvider); commands.registerTextEditorCommand( - 'cquery.inheritanceHierarchy', (editor) => { - setContext('extension.cquery.inheritanceHierarchyVisible', true); + 'ccls.inheritanceHierarchy', (editor) => { + setContext('extension.ccls.inheritanceHierarchyVisible', true); let position = editor.selection.active; let uri = editor.document.uri; languageClient - .sendRequest('$cquery/inheritanceHierarchy', { + .sendRequest('$ccls/inheritanceHierarchy', { textDocument: { uri: uri.toString(), }, @@ -613,7 +614,7 @@ export function activate(context: ExtensionContext) { InheritanceHierarchyNode.setWantsDerived(entry, true); languageClient - .sendRequest('$cquery/inheritanceHierarchy', { + .sendRequest('$ccls/inheritanceHierarchy', { id: entry.id, kind: entry.kind, derived: false, @@ -637,8 +638,8 @@ export function activate(context: ExtensionContext) { }); }) }); - commands.registerCommand('cquery.closeInheritanceHierarchy', () => { - setContext('extension.cquery.inheritanceHierarchyVisible', false); + commands.registerCommand('ccls.closeInheritanceHierarchy', () => { + setContext('extension.ccls.inheritanceHierarchyVisible', false); inheritanceHierarchyProvider.root = undefined; inheritanceHierarchyProvider.onDidChangeEmitter.fire(); }); @@ -657,13 +658,13 @@ export function activate(context: ExtensionContext) { const callHierarchyProvider = new CallHierarchyProvider( languageClient, derivedDark, derivedLight, baseDark, baseLight); window.registerTreeDataProvider( - 'cquery.callHierarchy', callHierarchyProvider); - commands.registerTextEditorCommand('cquery.callHierarchy', (editor) => { - setContext('extension.cquery.callHierarchyVisible', true); + 'ccls.callHierarchy', callHierarchyProvider); + commands.registerTextEditorCommand('ccls.callHierarchy', (editor) => { + setContext('extension.ccls.callHierarchyVisible', true); let position = editor.selection.active; let uri = editor.document.uri; languageClient - .sendRequest('$cquery/callHierarchy', { + .sendRequest('$ccls/callHierarchy', { textDocument: { uri: uri.toString(), }, @@ -678,8 +679,8 @@ export function activate(context: ExtensionContext) { callHierarchyProvider.onDidChangeEmitter.fire(); }); }); - commands.registerCommand('cquery.closeCallHierarchy', (e) => { - setContext('extension.cquery.callHierarchyVisible', false); + commands.registerCommand('ccls.closeCallHierarchy', (e) => { + setContext('extension.ccls.callHierarchyVisible', false); callHierarchyProvider.root = undefined; callHierarchyProvider.onDidChangeEmitter.fire(); }); @@ -688,7 +689,7 @@ export function activate(context: ExtensionContext) { // Common between tree views. (() => { commands.registerCommand( - 'cquery.gotoForTreeView', + 'ccls.gotoForTreeView', (node: InheritanceHierarchyNode|CallHierarchyNode) => { if (!node.location) return; @@ -702,14 +703,14 @@ export function activate(context: ExtensionContext) { let lastGotoNodeId: any let lastGotoClickTime: number commands.registerCommand( - 'cquery.hackGotoForTreeView', + 'ccls.hackGotoForTreeView', (node: InheritanceHierarchyNode|CallHierarchyNode, hasChildren: boolean) => { if (!node.location) return; if (!hasChildren) { - commands.executeCommand('cquery.gotoForTreeView', node); + commands.executeCommand('ccls.gotoForTreeView', node); return; } @@ -719,13 +720,13 @@ export function activate(context: ExtensionContext) { return; } - let config = workspace.getConfiguration('cquery'); + let config = workspace.getConfiguration('ccls'); const kDoubleClickTimeMs = config.get('treeViews.doubleClickTimeoutMs'); const elapsed = Date.now() - lastGotoClickTime; lastGotoClickTime = Date.now(); if (elapsed < kDoubleClickTimeMs) - commands.executeCommand('cquery.gotoForTreeView', node); + commands.executeCommand('ccls.gotoForTreeView', node); }); })(); @@ -751,7 +752,7 @@ export function activate(context: ExtensionContext) { }; function makeDecorations(type: string) { - let config = workspace.getConfiguration('cquery'); + let config = workspace.getConfiguration('ccls'); let colors = config.get(`highlighting.colors.${type}`, []); let u = config.get(`highlighting.underline.${type}`, false); let i = config.get(`highlighting.italic.${type}`, false); @@ -772,7 +773,7 @@ export function activate(context: ExtensionContext) { function updateConfigValues() { // Fetch new config instance, since vscode will cache the previous one. - let config = workspace.getConfiguration('cquery'); + let config = workspace.getConfiguration('ccls'); for (let [name, value] of semanticEnabled) { semanticEnabled.set( name, config.get(`highlighting.enabled.${name}`, false)); @@ -834,7 +835,7 @@ export function activate(context: ExtensionContext) { } languageClient.onReady().then(() => { languageClient.onNotification( - '$cquery/publishSemanticHighlighting', + '$ccls/publishSemanticHighlighting', (args: PublishSemanticHighlightingArgs) => { updateConfigValues(); @@ -851,10 +852,10 @@ export function activate(context: ExtensionContext) { continue; if (decorations.has(type)) { let existing = decorations.get(type); - for (let range of symbol.ranges) + for (let range of symbol.lsRanges) existing.push(range); } else { - decorations.set(type, symbol.ranges); + decorations.set(type, symbol.lsRanges); } } @@ -874,13 +875,13 @@ export function activate(context: ExtensionContext) { }); })(); - // Send $cquery/textDocumentDidView. Always send a notification - this will + // Send $ccls/textDocumentDidView. Always send a notification - this will // result in some extra work, but it shouldn't be a problem in practice. (() => { window.onDidChangeVisibleTextEditors(visible => { for (let editor of visible) { languageClient.sendNotification( - '$cquery/textDocumentDidView', + '$ccls/textDocumentDidView', {textDocumentUri: editor.document.uri.toString()}); } }); diff --git a/src/inheritanceHierarchy.ts b/src/inheritanceHierarchy.ts index b48613c..41d8e58 100644 --- a/src/inheritanceHierarchy.ts +++ b/src/inheritanceHierarchy.ts @@ -49,9 +49,9 @@ export class InheritanceHierarchyProvider implements return { label: label, collapsibleState: collapseState, - contextValue: 'cqueryGoto', + contextValue: 'cclsGoto', command: { - command: 'cquery.hackGotoForTreeView', + command: 'ccls.hackGotoForTreeView', title: 'Goto', arguments: [element, element.numChildren > 0] } @@ -68,7 +68,7 @@ export class InheritanceHierarchyProvider implements return element.children; return this.languageClient - .sendRequest('$cquery/inheritanceHierarchy', { + .sendRequest('$ccls/inheritanceHierarchy', { id: element.id, kind: element.kind, derived: element._wantsDerived,