Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Just My Code support for global symbol search #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,11 @@
"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."
},
"cquery.misc.workspaceSymbolJustMyCode": {
"type": "boolean",
"default": true,
"description": "If true, non workspace symbols are filtered from workspace symbols."
},
"cquery.misc.indexerCount": {
"type": "number",
"default": 0,
Expand Down Expand Up @@ -866,4 +871,4 @@
"type": "git",
"url": "https://github.com/cquery-project/vscode-cquery.git"
}
}
}
6 changes: 6 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function getClientConfig(context: ExtensionContext) {
['extraClangArguments', 'index.extraClangArguments'],
['resourceDirectory', 'misc.resourceDirectory'],
['workspaceSymbol.maxNum', 'misc.maxWorkspaceSearchResults'],
['workspaceSymbol.justMyCode', 'misc.workspaceSymbolJustMyCode'],
['index.threads', 'misc.indexerCount'],
['index.enabled', 'misc.enableIndexing'],
['enableCacheWrite', 'misc.enableCacheWrite'],
Expand Down Expand Up @@ -180,6 +181,11 @@ function getClientConfig(context: ExtensionContext) {
}
}

// Gather workspaceFolder paths in current workspace.
clientConfig["workspaceFolders"] = workspace.workspaceFolders.map(workspaceFolder => {
return workspaceFolder.uri.path;
});

// Set up a cache directory if there is not one.
if (!clientConfig.cacheDirectory) {
if (!context.storagePath) {
Expand Down