Comments (13)
Hi @AlexDai54202 . Would you be able to reproduce your captures with the Output
panel open, set to the C/C++
output channel, and with the "C_Cpp.loggingLevel": "Debug"
setting set? That should show us what's going on internally in the extension, simultaneously with your actions. There are various intentional delays (such as C_Cpp.intelliSenseUpdateDelay
, which delays squiggle passes until you've stopped typing for 1s), and it's possible VS Code's requests for these features may not be routed to the extension immediately, or as quickly as you might expect. There are also various other settings or conditions that might be contributing, which may be apparent based on that log output.
from vscode-cpptools.
Gotcha! This capture is after I set the logging level to Debug.
Apologies for the video not being embedded; the file is over 10 MB and I assume clarity is important here.
https://www.youtube.com/watch?v=bMeNMm5CAQQ
Additionally, the intellisense update delay does appear to be 1000ms.
I'm unfortunately not familiar with types of delay I should be looking for, but a quick search yielded:
from vscode-cpptools.
Hi @AlexDai54202, the update delay is for when we check for errors. We delay error checking so that you're not getting tons of red squiggles while you're in the middle of typing stuff that's still incomplete/uncompilable. The completion suggestions should not be impacted by this delay.
Your video is interesting and actually perfect because it shows the debug logging. What I am seeing in your logs is that the language server is restarting repeatedly. Something is shutting it down or it is crashing. That's why it's so slow. It's like it's compiling your file for every completion event and that's not expected. Can you drop a .txt file in this issue with the full debug log for this scenario? It scrolls by too fast in the video.
I tried your second scenario with the simple main
function on WSL on my slow laptop and didn't run into the same problem as you though. The suggestions pop up right after I type the 'a'. This is what it's supposed to look like:
video.mp4
from vscode-cpptools.
Thanks for the followup!
Just in case I goofed up somewhere, here's the process I used to get the log.
https://github.com/microsoft/vscode-cpptools/assets/84922496/a04849de-67f4-420a-8142-a0f3cb0a512e
And here's the log I got!
5-CC++.log
Just in case this may end up being helpful: in Youtube, users can use ,
and .
to move frame by frame in a video.
from vscode-cpptools.
Hi @AlexDai54202 . Have you set any of the following settings to values other than their defaults? C_Cpp.intelliSenseMemoryLimit
, C_Cpp.maxCachedProcesses
, C_Cpp.maxMemory
, C_Cpp.intelliSense.maxCachedProcesses
, C_Cpp.intelliSense.maxMemory
Those settings influence when we recycle IntelliSense translation units. Hypothetically, I might expect a problem like this to occur if those limits are set too low, causing IntelliSense translation units to be recycled almost immediately.
Otherwise, we're looking for some clue as to why your IntelliSense processes are only sticking around for a very short time. They appear to be getting shut down gracefully, before being immediately started again. Does this happen for you with multiple different projects, or on a different machine?
from vscode-cpptools.
I don't believe I have set any of those as anything other than default.
Not sure if this helps, but the only thing I've changed from default would be the setting "C_Cpp.default.cStandard": "gnu17".
This behavior doesn't seem to happen outside of the WSL/Docker server.
from vscode-cpptools.
Can you share how you configured your WSL/Docker server? I'm not sure if anyone on our team has worked with that before or not.
from vscode-cpptools.
Unfortunately, the docker image is not configured by me, rather by the course staff, so I'm not of much help there.
With that said, my WSL configuration is as follows:
[wsl2]
memory=2GB
(Located at C:\Users\myusername.wslconfig)
And my container configuration for vscode is
{
"workspaceFolder": "/home/student",
"extensions": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools-themes",
"ms-vscode.makefile-tools",
"twxs.cmake"
],
"settings": {
"C_Cpp.default.cStandard": "gnu17"
}
}
Which I got from the command palate (Open attached container configuration file)
from vscode-cpptools.
@AlexDai54202 Yeah, 2 GB of memory is likely going to be insufficient (4-8 GB is recommended as a minimum). You could use some program like top to see the memory usage of cpptools and cpptools-srv and your free memory? It looks like we'll tear down cpptools-srv if the free memory drops below 256 MB. Is your repro with just 1 .cpp file open or are you switching between multiple source files?
from vscode-cpptools.
@sean-mcmanus there's only one file open and we're tearing down IntelliSense while it's still in focus. I can't imagine a simple int main
file using so much memory though. On my WSL instance, that file uses 52 MB.
from vscode-cpptools.
@bobbrow I'm seeing the memory usage by the OS, VS Code, and cpptools be > 2 GB. I think it can be fixed by ensuring 2 clients are kept active (and adding logging for when the IntelliSense processes are shutdown due to resource limits).
from vscode-cpptools.
@AlexDai54202 Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.20.0, although let us know if you're still seeing other issues in your scenario with the 2 GB docker container.
from vscode-cpptools.
Horribly sorry for not keeping up - this project was absolutely killing me.
Configuring the WSL2 to be greater than 2 GBs fixed the issue. I cannot express how much gratitude I have for all of you for walking me through this. Once again, thank you all so much!
from vscode-cpptools.
Related Issues (20)
- #include completion incorrectly completes -isystem includes in `#include ""` HOT 1
- crashes on startup HOT 15
- rename function name doesn't work in C project HOT 9
- Designated initializers squiggles HOT 1
- Debugging on WSL - Must kill the integrated terminal after each debugging session, or gdb will not launch. HOT 1
- C long double bug HOT 1
- 调试控制台显示异常的汉字
- CPP2 - Modules HOT 2
- IntelliSense not linting code if headers are incorrect. HOT 1
- Single step in debugger collapses all variables being watched HOT 2
- __attribute__((packed)) breaks intellisense HOT 32
- JSDoc-style multi-line comments are wrongly indented HOT 3
- outline view doesn't keep updated when adding/removing code HOT 3
- Allow configuration providers to provide the `compileCommands` file path HOT 12
- On Windows arm64 with LIBPATH set: command-line error: invalid option: --using_directoryC/C++(571) HOT 1
- Outline for C is wrong. HOT 5
- Spurious Intellisense Errors on MacOS CMake project HOT 3
- Parsing Open Files Stuck in Infinite Loop HOT 12
- The GitHub readme is great, but the marketplace readme is bare HOT 2
- Cannot find c++ std headers even manually set include path. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cpptools.