how can i fix the problem with format on save in vs code? - vscode-extensions

Well "format on save" (in Vs Code) doesn't work, also tried Prettier but it doesn't work for React to.
Someone help!
format on save and Prettier in Vs code dont work!!!

Is the Default Formatter option set to Preitter?
File > Preferences > Settings and then search for the Default Formatter option and select Prettier from the dropdown menu.
If this doesn't work, uninstall and reinstall the Prettier extension.
last, of all is enable format on save enabled?

Related

SyncedSideBar on Atom IDE

Is there away to install SyncedSideBar or something similar to that for Atom IDE ?
I used this one on my sublime text 3, and I was looking for the same plugin that will work for Atom.
I like how it auto highlight the current opened file
Any suggestions ?
You don't need any extra plugin for this. It there in the default tree plugin. Search for tree in packages
Click on settings and check the Auto Reveal checkbox
And now the active file will be automatically highlighted
Some of the themes may not highlight this properly, so you should change the theme and make sure it works. Sometimes after changing the settings you may need a restart, if it doesn't work

How to format curly braces for autoformat in intellij

Whenever I hit alt-cmd-l to autoformat my code, it formats my imports and arrays from:
import { CommonModule } from '#angular/common';
let arr = [ myStringVar ]; // simple example, just go with it
to
import {CommonModule} from '#angular/common';
let arr = [myStringVar];
How do I tell IntelliJ to put a space after the opening brace and before the close brace when auto-formatting? (Specifically for javascript, typescript)
I've looked around for the answer and could not find one or asked the question badly. So I apologize if this is duplicate.
I'm on Intellij 2016.3.3
Go to preference, select Editor > Code Style > Javascript and choose Spaces, check the checkboxes in Within section "ES6 import/export brances", and if you want spaces in object literal braces, check "Object literal braces" and as well.
Go to settings and search for ES6 import/export braces. It should take you to Editor -> Code Style -> Javascript (or TypeScript). Just hit that checkbox on the spaces tab and it should add the spaces back.
As you are using Angular, I believe you need to edit the settings for the Typescript and NOT for JavaScript. As I am using IntelliJ IDEA 2021, I will give you the fix for the same. You can do so by going through the following path:
Go to File > Settings... > Editor > Code Style > Typescript
Click on the Spaces tab.
In the Within collapsible, tick the checkbox that says "ES6 import/export braces".
Click on Apply button and then click on Ok button.
If you now go to the Typescript file and hit the combo: Ctrl + Alt + L, it should now format the file correctly.
CAVEAT:
You have to be careful to ensure that you are making the changes for the Scheme that is applicable for your project. For example, maybe you have customized your Editor in some way previously and saved your customizations under a new name, such as MyCustomSettings. Once you do this, you will notice that there is an additional Scheme called the Default scheme. But MyCustomSettings will be your Scheme for your project and you have to make sure that you make the changes for the MyCustomSettings Scheme and not for the Default scheme. You can refer to the Schemes via the following path:
File > Settings... > Editor > Code Style > Typescript, there is a dropdown referred as Scheme. Choose the appropriate one for your Project and make sure you make the above edits in that Scheme.

Remove/change Matching Brackets Highlight in VSCode

The default matching brackets/parentheses highlight is too intrusive/bold for my liking and compare to Atom.
I can't find a way to disable it or change.
Is there CSS somewhere or an extension?
PS: This is for VSCode not Visual Studio.
preferences -> settings and add this line in settings.json file
editor.matchBrackets": false

IntelliJ Code Style Indentation Options seem to be ignored [duplicate]

I've been attempting to get my Intellij IDEA to confirm to a google-like Java standard - however both imports and manual settings seem to be ignored.
Here's how my indentations are currently set:
However my code still formats at 4 spaces, and when I reformat it goes to 4 spaces as well.
Thanks in advance!
This is the setting for your GoogleStyle scheme. But your project most likely doesn't use it. It's not enough to just select it in the combobox. You need to import this scheme into your project.
Click Manage... and Copy to Project, and it should work as expected.
Also, make sure you're setting language-spefic settings, so instead Code Style select Code Style > Java.

How do I stop wrapping code when reformat code in phpstorm?

If my code reaches the right magin and I reformat code (Ctrl + Alt + L), PHPStorm automatically wrap code. How do I stop this (reformatting code with wrapping)?
I'm working with php and other languages for web development
See under Preferences > Code Style, where you can tweak by language.
Also check the settings under Preferences > Code Style > General (affects all languages):
I found this worked for me for the auto format wrapping issue:
Preferences > Editor > Code Style > HTML
From there, change the Wrap Attributes dropdown select to Do not wrap and I also unchecked the box Wrap Text. See below:
Edit: I should add that I have the PhpStorm version 2018.2
In newer PhpStorm (and other IntelliJ IDEA based IDEs) versions option is renamed to Wrap on typing and moved to Preferences -> Editor -> Code Style.