so I recently got started with vscode and working with the c project when I noticed that some of the errors aren't displaying. Also, the program would run fine on vscode but when used it on repl.it it would show some critical errors like "signal: Aborted (core dumped)" and it would tell me at which line it encountered that problem.
Looking at vscode however it seems to me it doesn't detect subtle errors such as when I have a function that would return a string and I purposely return 0 instead of a string it still considers it a valid operation. I don't know if the issue is the IntelliSense or some error-checking aspects, but one thing for certain I know visual studio would show this with a warning sign that would appear on the number line.
I do have the squiggly lines enabled for errors and it does show errors if I have some keyword typed incorrectly. What I want to know is where the c would fail to run and tell me before the run, or even during runtime.
screenshot of no error when there should be
CodePudding user response:
VSCode is pretty intelligent, and in theory it should be able to have all the IntelliSense that those other IDEs have. However, that does not come out of the box. What you need to do it install some extensions specific to the programming / scripting languages that you work with. For example, for C you can download C/C extension developed by Microsoft.
After installing the needed extensions please read some documentation and tweak them as needed.
Your IntelliSense issues will be solved.
CodePudding user response:
I've figured out that it wasn't displaying the crash errors because my installation of msvc was flawed. I downloaded msvc again and used the Pacman commands to install all the necessary files and now my crash errors show. However, some syntax errors still don't show like int main {... without a closing curly brace. This code still runs, and the error is picked up during the run time. I would've expected the error to be highlighted before the run.