I want to ask about error in code block in Django - django

This is code for a template which i am trying to inherit. This is not giving any error in programme but what these warning are trying to suggest

Basically, VSCode uses linters tools to analyze code errors. Linters can show the errors and warnings you see there.
If the installed linter doesn't support the syntax/wasn't written for this syntax, it will throw an error/warning. It's common to see those, and you can force-ignore them on VSCode Settings (More info here).
You can also change and set the linter by yourself on settings, or you can install an extension that does that for you.

Related

Vscode doesnt show errors on the IDE like other IDEs such as (visual studio 2019, repl.it, etc.)

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
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.
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.

Prettier doesn't format my code in Visual Studio on Next.js

Prettier has worked fine on my projects to date.
I just started a new next.js project, and while problems are reported in the terminal window, and the prettier extension is a dev dependency for the project, it does nothing to format my code. the little lightbulb does not appear anywhere (just red underline).
Is there something special required for SSR?
Make sure that Prettier is enabled as your default formatter. See here for details on how to do that.
Make sure that Format On Save is enabled, or that you're calling the formatting option manually.
Resolve all errors, then try again. Personally, Prettier refuses to format if there are any errors. Warnings are fine, but only if all errors are resolved does Prettier perform formatting, on my projects.

VSCode does not show errors before building

I use VSCode(code editor, not IDE) for C++ with only Microsoft's C++ extension and today I have encountered a problem here. When I write the wrong syntax, the "PROBLEMS" panel does not show errors. It only shows errors on building the code. Earlier that wasn't the case. How do I fix this ?
Before building:
After building:
I got that error by Disable error squiggles. If you don't reach that error in my case, don't read anymore.
After ignoring, I got your problem:
To fix this, open settings.json file:
Scroll to the end, then set "C_Cpp.errorSquiggles": from Disabled to Enabled.
After reading the question, and the comments, my understanding is that you want Visual Studio Code to tell you when you make a mistake on the sintax, without having to compile the project.
What could be wrong is your C++ IntelliSense, which is odd because it comes in bundle with the C/C++ extension from Microsoft. The extension itself might be disabled, corrupted during an aborted update, or uninstalled.
Have you tried the good old and helpful uninstall and reinstall the extension? That normally fixes my problems with extensions in Visual Studio and VS Code
Note: You have to install the extension first: C/C++ IntelliSense, debugging, and code browsing extension
This is because the C/C++ IntelliSense, debugging, and code browsing extension does not know about the current project.
Navigate to View | Command Palette, enter and select C/C++ Build and debug active file: Select
Project, and then select the correct project that you want to work with.
This will help you see the problems as you create your code without requiring you to run it.
The extension has to know that it is allowed to continuously check your code.
I hope this helps you in the future with other extensions too...
Try and close your current folder and open a different folder. Then come back to your original folder. This worked for me.

VS Code throws me to settings.json when trying to compile c++ code

I can't compile any c++ code in VS Code. Whenever I try, it throws me to the settings.json file, where I see this:
{
"python.defaultInterpreterPath": "C:\\Users\\Pavel Sankin\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe",
"python.pythonPath": "C:\\Users\\Pavel Sankin\\Anaconda3"
}
and nothing else. I did install the standard C/C++ extension and tried checking out the official website for help, but there seem to be other things there. VS Code doesn't throw any errors, it just opens this file whenever I try to compile any piece of C++ code.
Any help will be much appreciated.
Have you had this problems before?
Have you install the microsoft C++ compiler toolset? (other compiler works fine too; check VS docs)
Did you open VSCode using the Developer Command Prompt?
Also check this and follow the guide.

VS Code display compile error messages for clang

In atom, when I write any code incorrectly I can view the errors immediately because the file is being scanned by a plugin.
I have the vs code plugin for c/c++ but I do not see this option to display errors. Is this available and I am just failing with my google skills? Or is this not an option with vs code?
The VSCode plugin for C++ does not support "intellisense" at the moment.
It supports debugging and some basic symbol parsing (with code completion) but it doesn't parse your code using a compiler.
For more info: https://code.visualstudio.com/docs/languages/cpp