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

symbol search doesn't work #1060

Closed
Kurt-Shiwz opened this issue Sep 23, 2017 · 8 comments
Closed

symbol search doesn't work #1060

Kurt-Shiwz opened this issue Sep 23, 2017 · 8 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service

Comments

@Kurt-Shiwz
Copy link

Some lib I don't download, so don't add to include path and browse path, but I don't understand why I can't find symbol in the file.

* Operating System and version
   macos 10.12.6 
* VS Code version and if you are using the Insiders build
   1.16.1
* C/C++ extension version
   0.12.4
* Other extensions you installed and if the issue persists after disabling them
  no
* step-by-step instructions to reproduce the issue
* A small code sample, zipped up project, or open source repo we can use to verify the bug
* Relevant settings from your settings.json, c_cpp_properties.json, and/or launch.json files

{
"files.autoGuessEncoding": true,
"files.autoSave": "onFocusChange",
"files.exclude": {
".*": true,
"/CVS": true,
"
.a": true,
"/.DS_Store": true,
"
/.git": true,
"/.hg": true,
"
.o": true,
".so": true,
"
/.svn": true
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"editor.fontSize": 12.5,
"editor.formatOnType": true,
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"editor.renderWhitespace": "all",
"editor.useTabStops": false,
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.fontFamily": "menlo",
"window.openFilesInNewWindow": "off",
"workbench.colorTheme": "Monokai",
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"workbench.iconTheme": "vscode-icons",
// golang
"go.buildOnSave": "workspace",
"go.buildFlags": [],
"go.coverOnSave": false,
"go.formatOnSave": true,
"go.formatTool": "goreturns",
"go.goroot": "/usr/local/go",
"go.gopath": "/Users/kurt/project/go",
"go.lintFlags": [],
"go.lintOnSave": "workspace",
"go.vetFlags": [],
"go.vetOnSave": "workspace",
"go.useCodeSnippetsOnFunctionSuggest": false,
// c++
"C_Cpp.addWorkspaceRootToIncludePath": true,
"C_Cpp.autocomplete": "Default",
"C_Cpp.errorSquiggles": "Enabled",
"C_Cpp.intelliSenseEngine": "Default",
// "C_Cpp.intelliSenseEngine": "Tag Parser",
"C_Cpp.intelliSenseEngineFallback": "Enabled",
"C_Cpp.formatting": "Default",
"C_Cpp.clang_format_formatOnSave": true,
"C_Cpp.clang_format_sortIncludes": true,
"C_Cpp.clang_format_fallbackStyle": "{{BasedOnStyle: Google, IndentWidth: 4}}",
"C_Cpp.clang_format_style": "{BasedOnStyle: Google, IndentWidth: 4}",
"C_Cpp.navigation.length": 100,
//setting sync
// align
"alignment.operatorPadding": "right"
}

{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include/c++/4.2.1",
"/usr/include/c++/4.2.1/tr1",
"/usr/local/include",
"/usr/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include/c++/4.2.1",
"/usr/include/c++/4.2.1/tr1",
"/usr/local/include",
"/usr/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
image
image

@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state labels Sep 25, 2017
@sean-mcmanus
Copy link
Collaborator

For the Mac configuration, can you change your browse.databaseFilename property to something like "${workspaceRoot}/.vscode/vc.db" and see what it's size is? You can also try closing all your VS Code instances, then kill all the Microsoft.VSCode.CPP.* processes (dangling ones accessing the same database can cause failures). Does Go to Definition or hover work for any global variables?

@Kurt-Shiwz
Copy link
Author

Kurt-Shiwz commented Sep 25, 2017

vc.db is 18M, it take 15 minutes to get it. after that i also can't find symbol. i just want find symbol in the current file, how could it happen.... @sean-mcmanus

@sean-mcmanus
Copy link
Collaborator

@Kurt-Shiwz What happens if you create a new file and add some uniquely named variable (int) and do a Go to Symbol in File (@)?

@Kurt-Shiwz
Copy link
Author

Effective, but it take a long ting to tip. when i empty browse.databaseFilename it faster.
And, when I open a new project or file it will take sometime to tip, slower than sublime text.
I also find when browse.databaseFilename is set, vc.db will allways clear and rebuild when i reopen the project, even the includepath/browsepath don't change and don't add new files. it take a long time. @sean-mcmanus

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Sep 26, 2017

What do you mean by "tip"?

@Kurt-Shiwz Thanks a lot for reporting the that the database is clearing -- it's a regression (I suspect with 0.13.0). We should fix that soon. Also, the clearing is occurring even when the databaseFilename is left unchanged (it's just clearing in the default workspaceStorage location).

@Kurt-Shiwz
Copy link
Author

image
image

it take 2 seconds to show, slower than sublime text

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Sep 27, 2017

@Kurt-Shiwz Yes, I've noticed that the symbol searching is slow (I've seen a lot longer than 2 seconds). We haven't investigated making that scenario faster yet. The database emptying is primarily due to a VS Code bug that is killing our process before we're able to mark the database as safe to use: microsoft/vscode#35196 . If you wait for >5 seconds after a database is modified, then the database clearing should not occur (unless we have additional bugs).

@sean-mcmanus sean-mcmanus added bug fixed Check the Milestone for the release in which the fix is or will be available. and removed more info needed The issue report is not actionable in its current state labels Oct 4, 2017
@bobbrow
Copy link
Member

bobbrow commented Oct 5, 2017

A fix for DB clearing has been released in 0.13.1.

@bobbrow bobbrow closed this as completed Oct 5, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

3 participants