So Prettier is finicky as it is, but here's a weird situation. The image below shows what happens after a save in VS Code with Prettier set up normally. It randomly removed the tabs for these two lines. If I tab it back into place and save it does it again.
Can anyone tell me why, and how to stop it? Makes the code look really bad.
Related
I would like to change the following VS code behavior but can't find a way to do so:
When the cursor is on some items a box pops up with info about that item. I find this extremely annoying as it often blocks what I'm trying to edit. How to disable the pop up?
I code CSS on a single line, such as:
h1 {something; something; something; } And the next CSS on the next line. No Spaces!
But when I save it VS code automatically reformulates it, putting each something on a new line. This is extremely, extremely annoying! It horribly wastes space, and forces me to scroll down a lot to find something I want to edit. How do I get VS code to stop messing with My Coding Style?
To disable the pop up. Do these necessary changes Disable pop up
To stop the CSS formatting, just see in the extensions if you have downloaded CSS formatter, if so then uninstall it or disable it.
"press the restart button to restart Visiual Studio Code and enable the setting."
Now Im going to preface this by saying that this is quite possibly the most annoying thing I have ever experienced in my years computing.
I'm new to VS Code and as such I am knee deep in my settings.json a lot of the time. Especially moreso when Ive just installed a new extension and it comes with loads of parameters, alnd all sorts of goodies - sort of like I did today when I got home from work.
I open settings.json. I add a comment line indicating a new section for my new extension's myriad of settings I half understand, and move any auto-generated config settings from the bottom to the freshly minted position. I start typing, the widget pops up letting me know about all 70+ settings I can fiddle with as much as I please.
I hit tab on the first entry, it goes down. Tab again, "true" goes down.
"A setting has changed that requires a restart to take effect"
OKAY no problem VS code. Quick restart, back to my config.
I start typing the extension again, I get 200ms in or however long it takes for that widgit to appear, and
"A setting has changed that requires a restart to take effect"
I watch the text in my editor contort as the settings are unloaded and reloaded and unloaded again.
I got the first 4 characters of the extension name typed out before this lovely notification reappears.
Now,
when this happens a few times its a little irritating.
BUT THIS IS CONSTANT .Every. Single. Line. I try to add. Each and every setting. Sometimes 2 or 3 times before I actually get the string down, never-mind its value.
I don't know what to do, I am legitimately going to rip my hair out. This is by far easily up there with one of the most frustrating things I have ever been forced to endure. It is relentless.
I dont know what else to do. Ive tried all I can think of.
I just want to learn and use my new extension.
Please for the love of anything help me.
Please.
Recently, I wrote a block of code, and tried to copy and paste some functions around the code. But when highlighting the block of code I am trying to select, it exhibits strange behaviour. The first picture is the faulty case, and the second picture is the normal case.
First of all, I can click anywhere on my script even though I dont have spaces there.. if that makes sense (sorry I cant explain it any other way). Second, when I drag my mouse up, it drags up for only that section. Looking at the faulty screen shot, if I were to copy that block, it would only copy the parts in blue... Normally when I drag my mouse up, it automatically highlights the whole line as seen in the normal picture. Also, notice the giant white line on the faulty highlighting compared to the normal highlighting. I am wondering how I can go back to my old normal highlighting...
I think I was able to reproduce the problem by enabling column selection mode.
Try going to Edit-->Column Selection Mode. Uncheck it. If this was the problem, perhaps it was a finger flub which performed a shortkey operation.
Anyone knows how to disable automatic removing tabs on new line after delay? Like you can see on picture below, VS Code deletes tabs on new line everytime when I don't start typing very fast.
Something similar is situation when I'm writing comment, create space and wait for a while. VS Code will delete my last space.
I fixed this by turning off the setting "files.autoSave", (I didn't want that in any case.) or disable your formatting tool. (most likely cause)
My problem was that I had a formatting tool run on save, which was removing excess white space and therefore squashing my tabs during editing. Looks like you have the same problem to me.
You can affect a delay if you want to use the auto-save feature by setting auto save to afterDelay and setting the delay to your liking
So, Ive been using Visual Studio code now for several months, and I love it. BUT, there is one thing that is driving me nuts that I'm tired of dealing with.
VSCode has a terrible habit of changing my text when i hit TAB or ENTER at the end of typing. For example, Let's say I'm writing something and I want to tab over a few tabs. So, as an example:
I type "fix", meaning, i hit tab at the end so I can tab over a few columns. When I do this, my line changes to:
"<fix></fix>" (hope this doesnt looks weird, I had to edit to the tags wouldnt be hidden)
So, in order to tab to the right for in-line comments or something, I have to hit SPACE before i hit tab. Lame.
Similar stuff happens when I hit enter immediately after typing something. It changes my text to something else before leaving the line. So, again, I find myself adding an extra space at the end of every line.
Does an extra space hurt me in the long run? No. But my OCD is freaking out over it.
I dont have tab autocomplete turned on, so why is this behaving as such?
I'm using vscode on a Mac. I disabled and uninstalled all extensions... still happens.
So yeah, I've messed with this for days, and only now after I post a question do I figure it out. These two settings took care of my issues:
// When enabled, emmet abbreviations are expanded when pressing TAB.
"emmet.triggerExpansionOnTab": false,
// Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.
"editor.acceptSuggestionOnEnter": false
Emmet was the tab issue, and the accept suggestion on enter was the second, even though no suggestion was showing. Hope this helps someone else...