VSCode Error/Warning Validation Decoration Setting - visual-studio-code

10 shillings to whomever can tell me how to switch the error/warning decoration in vscode from a squiggly underline to an outline. It's what I am used to in Sublime Text, but I cannot seem to find the option to change it in vscode. Perhaps it is not possible? Knowing that would be a sufficient answer too.

As far as I know, there isn't a setting for this.
There IS an extension point for decorating text that would allow this, but as far as I know it isn't possible to access the errors for a file from the API to decorate the text. You can create new ones, but I don't believe it is possible to access existing errors.
tl;dr - I don't think this is possible at the moment.

`Microsoft/vscode issue 9209 points out more recently (2019/2020) to:
Error Gutter: This is the VSCodium (or Visual Studio Code) version of error gutters available in other text editors, such as Sublime Text or Atom.
And:
Error Lens: ErrorLens turbo-charges language diagnostic features by making diagnostics stand out more prominently, highlighting the entire line wherever a diagnostic is generated by the language and also prints the message inline.

Related

What extension is causing my custom php snippets to get overwritten, and how can I fix this?

If this is due to an extension, how can I remove that extension?
It overwrites my custom snippet, which bothers me.
I disabled many extensions, but nothing changed.
What you're seeing in your screenshot (suggestions for dba_<etc.>) are not coming from any extension. One can verify that by running the command Developer: Reload With Extensions Disabled and trying triggering suggestions again. So this is just functionality that comes out-of-box with a standard VS Code installation. You don't even need to install any PHP extension to get this.
As for your custom snippets getting "overwritten", it's hard to tell without more detail why this is happening. If you're on version 1.75, it might just be due to a bug that will be fixed later (Ex. As was the case in this other recent Q&A: Visual Studio Code's recent update is disrupting autocompletion).
As #Mark showed in their answer, these are function suggestions. You can disable function suggestions with the following setting:
"[php]": {
"editor.suggest.showFunctions": false
}
Those icons indicate that those are Methods and Functions (not Snippets). See What do the Intellisense icons mean.
So you can try to disable two settings in your Settings UI:
Editor > Suggest: Show Methods
Editor > Suggest: Show Functions - this looks like the right one to disable
Of course, there might be situations where you want to see Function suggestions, so you will have to see if disabling the setting is acceptable.
You can disable those Function suggestions for php files only with this setting (in your settings.json):
"[php]": {
"editor.suggest.showFunctions": false
}

how to specify what's considered an error, so that I can get squiggly lines

I'm programming in C, and often times I see myself forgetting to type the '&' when using scanf. I've used replit in the past and there, in that case the variable gets a squiggly underline showing it's wrong. Is there any way I could configure this in VS Code, in other words, can I specify what's considered an error?
Add the C/C++ extension from Microsoft. It will add IntelliSense
Use this link to learn how to add extensions: LINK
Use this link to read about customizing IntelliSense for your needs: LINK
(unless it already does what you need)

VS Code, Syntax highlighting Powershell

Ive been scratching my head with this one. Previously VS Code highlighted Powershell scripts and modules just fine with highlighting functions in yellow and variables $var in light blue. Both as part of a string and "stand-alone". However, suddenly it doesn't highlight functions or variables anymore? I've tried to uninstall and reinstall the powershell extension from Microsoft, as well as disable and re-enable the built in language support for powershell.
I've not been able to find any support regarding this issue and hope that I might be able to find it here.
Have you tried this?
File Association.
Basically:
The easiest way I've found for a global association is simply to Ctrl+k m (or Ctrl+Shift+P and type "change language mode") with a file of the type you're associating open.
In the first selections will be the option "Configure File Association for 'x' " (whatever file type - see image attached). Selecting this gives you the option to choose the language and will then make the filetype association permanent.
if you start your code block with a ```PowerShell it will highlight the syntax properly.
I've noticed that you may also need to end your code block with a ``` in VSCode specifically.

How can I prevent html tags from being red underlined inside of .ejs files?

If I start an .ejs file with a tag like h1, it is underlined in red, like VSCode expects me to add the whole typical html boilerplate. However, I have seen many videos where the host doesn't get this underlining.
I have tried extensions, I have modified the settings.json with "*.ejs": "html", but nothing works.
Do you know how I can get rid of it without having to add DOCTYPE, , etc.?
So after figuring out that this problem caused by a lint or other validator (in this case W3C Validator) installed as an extension in Visual Studio Code, you can disable its warnings by going to extensions and disable the validator.
However, those tools are here for a reason :) and they help us write better code that fits to known standards and syntax issues, so disabling them is less recommended. (Although it can become bit annoying while using external third-party libs which can be can some warnings by that validator too - for that, some lints offers ignoring logic which let you ignore some of the files or lines in the code).
Good Luck, Happy coding!

Indentation for files that don't have a registered formatter

It seems that I am getting this problem since version 1.18, honestly I don't remember.
With VSCodeVim installed I used to press the = key to get my code (Elixir, embedded elixir, ...) indented properly.
Am I missing something, like a configuration, that would allow me to re-indent my files without having a nagging "Formatter for file x not installed".
This is honestly the only things that nags me with VSCode so far, love the speed, the capabilities and the UI...
Just posting my comment as an answer
Try using the reindent lines command. This command should work for many languages even if you don't have a formatting extension for that language installed
Select the contents of file.Bottom right corner shows spaces/tabs: 2/4. You can click on that and indent the whole file.