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

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.

Related

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.

Red squiggles do not appear in VS2008

I am using VS2008 pro and while autocomplete works properly I get that problem. My project is in visual c++/MFC and advanced settings are there for C#, but not for C/C++ as you can see below in order to enable them.
I figured out that it may be Intellisense that does not work properly, so have tried to clean my solution file and deleted .ncb and rebuild my project as others suggest, but without success. I have tried to create other projects, and the problem insists.
Finally, as an alternative I have found that I can use Virtual Assist, but this is the last choice for me.
So, how could I make red squiggles work again?

I want to ask about error in code block in 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.

Disable resharper autosave on new line

I have a bit of a weird problem here. I am running visual stduio 2017 with resharper and any time I press enter in a .ts file, the file is automatically saved. The weird thing is, this only happens for .ts files and not for files like .cs, .css, .html, or .less. I know this is somehow caused by resharper, because if I disable resharper, the problem doesnt occur.
There's no such functionality in ReSharper. You probably use some third-party add-in which causes this problem.
I also noticed this behaviour today. It's quite frustrating as it can cause noticeable performance problems due to excessive triggering of "compile on save".
Disabling ReSharper in the Visual Studio extensions screen makes the problem go away, re-enabling the extension causes it to come back. I have no other 3rd party extensions enabled so it is undeniably caused by ReSharper.
I have logged a bug here (I don't know if it's visible to other users):
https://resharper-support.jetbrains.com/hc/en-us/requests/2796884
In the meantime I've disabled compile on save and am compiling manually as needed.

QtCreator and ClangCodeModel plugin

I just installed QtCreator 4.7.2, which comes with ClangCodeModel plugin by default on. After my CMake project was parsed I saw much better highlighting of keywords in the code and also awesome intellisense handling of auto declared variables.
The downside was that the ClangCodeModel plugin was buggy, and gave me errors and warnings in parts of code that didn't make sense, especially the ones in 3rd party library header files. So I was forced to turn it off.
I'm wondering if Clang can be configured in QtCreator, so that minimal checks can happen. I played with these settings, but nothing made a difference:
1) Has anyone been able to configure this plugin in QtCreator so that it can work better? I am mostly concerned about intellisense. I can open the same CMake project in Visual Studio and I have much better intellisense there, but I prefer using Qt Creator.
2) If #1 is not possible because the plugin has bugs, what are the other means of improving intellisense in Qt Creator with CMake projects?
The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.
To configure the Code Model, you should go to "C++ > Code Model":
You also have the possibility to override this settings on a per-project basis:
In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want: