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

Disable recursive includePath for ${workspaceFolder} in default c_cpp_properties.json #2059

Merged
merged 2 commits into from
May 31, 2018

Conversation

yunlingz
Copy link
Contributor

@yunlingz yunlingz commented May 30, 2018

Disable recursive includePath for ${workspaceFolder} in default c_cpp_properties.json

Origin c_cpp_properties.json generated

"includePath": [
	"${workspaceFolder}/**"
],

Now

"includePath": [
	"${workspaceFolder}"
],

Why

On macOS 10.13.4, VS Code Version 1.23.1. C/C++ Extension 0.17.3

Maybe you can test the Extension based on this environment.

If we use the origin auto-generated c_cpp_properties.json which suggest ${workspaceFolder}/** in includePath, this will cause the automatic completion to fail, and sometimes it will lead to high CPU usage.

qq20180530-123411 2x

After I change ${workspaceFolder}/** to ${workspaceFolder} in includePath, Automatic completion started working properly.

screen shot 2018-05-30 at 12 35 48 pm

I searched the internet and I found this bug not only happened to me. I just happened to find that disable recursive includePath for ${workspaceFolder} in default c_cpp_properties.json can solve this problem. (But I think this may be a bug about recursive includePath.)

@sean-mcmanus
Copy link
Collaborator

Can you give more repro info on the case where automatic completion fails? If you add a new header you may need to save first before the header will be picked up for completions.

@yunlingz
Copy link
Contributor Author

@sean-mcmanus The environment description has been updated in the previous paragraph, maybe you can test the Extension based on this environment (macOS 10.13.4, VS Code Version 1.23.1. C/C++ Extension 0.17.3).

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented May 31, 2018

We've fixed the 100% CPU "livelock" and improved the perf by ~4 times with recursive includes for 0.17.4-insiders so we don't think disabling it by default will be necessary, but we might change our minds. We're also investigating additional performance improvements for later.

I think you can also set the C_Cpp.default.includePath setting to "${workspaceFolder}" as another workaround.

@yunlingz
Copy link
Contributor Author

Thanks for your great work, I will try the insiders branch.

@bobbrow
Copy link
Member

bobbrow commented May 31, 2018

@hyzeta we plan to publish a VSIX with the fix this week. Cloning the insiders branch and building yourself won't actually pick up the fix since it's in the server code which is not open source.

@sean-mcmanus
Copy link
Collaborator

@hyzeta Our perf fixes aren't ready yet, so we decided to disable recursive includes by default for 0.17.4.

@sean-mcmanus sean-mcmanus merged commit b5e00c0 into microsoft:master May 31, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants