Visual Studio Code Space Errors - visual-studio-code

I have tried lots of settings based on my google searches and all of my imported files still have errors regarding to the spaces/indentation.
Please use space for indentation.
Every file is full of these crazy errors.
How in the world do you get rid of this? I've tried to disable Detect Indentation settings amongst others but nothing seems to work.

The problem was the Prophet Htmlhint setting. Simply uncheck that and this will fix the issue.

Related

Different indentation in VSCode in the same project

I've always worked in VSCode indenting either with spaces or tabs, but with a size of 3 or more. But, currently, I'm working on a project where everything is configured to work in a size of 2. My issue is I really struggle to read with that size, I can barely identify each line of code and indentations, even with the visual guides that VSCode gives, and it is super uncomfortable to work in this way. I guess I have some visual impairment.
Is there an easy way, to work on a size of 3 or more for development purposes, but keep the files of the project in their original size? I'm looking just for a visual solution.
I couldn't find anything related, the only thing that I can think of now is every time I merge my changes, change the Prettier config, and format everything again, but I guess this could create issues for the maintenance of the repository.
Thanks in advance for your help!
I've found a VSCode extension called stretchy-spaces, maybe it will solve your problem
https://marketplace.visualstudio.com/items?itemName=kylepaulsen.stretchy-spaces

VS Code - command 'emmet.expandAbbreviation' not found

Emmet Abbreviations are not working for me in VS Code. I looked up solutions, and added "emmet.triggerExpansionOnTab": true to my settings.json file.
When I added it, every time I pressed tab to indent it says "command 'emmet.expandAbbreviation' not found".
It stops showing that once I remove the line.
Additionally, there is no syntax coloring or suggestions in HTML files. I tried to fix it by adding "files.associations": {"*.html": "html"} but that didn't work either.
Does anyone know how to fix this?
I had this issue too, but I simply restarted VS Code and that actually solved the problem!
I had the same issue as well and could not find much help.. but what fixed it for me was using a previous version.. so something with the never version might not work with my settings I guess (and some them I can't change like my Mac OS..;-).. as my mac is 2015 edition).. Anyways if you are still having this issue.. this link is what worked for me..
https://code.visualstudio.com/updates/v1_55
Download an earlier version and you should be fine...
I simply commented out "emmet.triggerExpansionOnTab": true then it started working.
After trying a lot of different things (including re-installing vscode) I got desperate, disabled all of my extensions, reloaded vscode, and then reinstalled my key extensions. I didn't figure out which extension may have been causing the problem, but that did get it working again.
I solved it by re-enabling the emmet extension again. Not sure when it has been disabled.
Open the built-in extensions explorer (direct command: Extensions: Show Built-in Extensions), scroll down to find the emmet extension. For me it was disabled, and I had to open the context menu and click Enabled.
I recently encountered this problem after a VS Code update. I searched for disabled extensions and saw that, to my surprise, some 2/3 of my extensions have been disabled. I manually enabled one which seems to have triggered something because within seconds all these extensions (except those I actually had disabled some time ago) were live again.

How do I turn off "Contains emphasized items" in Visual Studio code?

I need to figure out how to turn off emphasized items in Visual Studio Code
This might sound like a strange requirement, but in my workflow vscode functions as less an IDE than a cross-platform ViM-esque frontend with lots of remote development tools built-in.
Due to this use case, I don't need or want the linting features to show up in the file browser. How might I accomplish this?
Attempts to solve the problem
I've run out of search terms here and cannot find an answer.
Searches including terms in this question's title yielded little
SO-specific search queries also yielded little
This seems to be somewhat related, at least as a representation of the "feature" I'm referencing: VS code containes emphasized items but no error
VSCode "preferences" do not appear to show what I'm looking for, likely an issue with me not searching for the right variable name.
In my experience with VSCode it has been wonderfully customize-able, so I'm guessing there's a setting somewhere ready to be modified to accomplish this. Any help much appreciated, thanks!
My use case was a bit different: after viewing some files in a git submodule those files became linted, and errors and warnings cluttered up my VS Code Explorer file browser window on files I had no intention of ever handling. I basically wanted a way to clear out those lint warnings, and found it here. The solution is to reload the window:
CtrlShiftP on Windows/Linux, ⌘ShiftP on Mac -- then select "Developer: Reload Window"
One by-product of reloading the window is that it clears out those unwanted warnings (at least until the next time I visit the file). It also has the effect of clearing out warnings on files that I would normally want to see, of course, but chances are I'll be visiting those files again soon, so it's fine. Not a perfect solution, but it works for me and my use-case; hopefully it can help others.
I don't know how to turn it off, but I had this on multiple folders and I fixed it by renaming the folder to a random name, then naming it back to the name it was before and the error would go away.
If you have this issuse then uninstall extention then CtrlShiftP on Windows/Linux, ⌘ShiftP on Mac -- then select "Developer: Reload Window" then type developer: relode page this issuse automatically resovle
i have this issuse then i uninstall extension then this issuse resolve.
I was able to permanently prevent this by adding the files to the .gitignore file. It seems that this happens in a cloned repository when you add new files.

VS Code cursor jumping to bottom

Why does my cursor jump to the last line of code when I create new tags? For example, when I type a comment in HTML, as soon as I type the !, it jumps to the bottom. What setting do I have to change to prevent this from happening? It is very annoying. I am just starting to use VS Code so sorry if this is a really simple fix.
I had a similar issue. The Flow Language Support extension was causing it. I disabled it, and then the issue was gone.
I had the same issue when I first started using vscode.
Explanation
Generally, the issue is caused by an extension of some sort that is messing with your IDE. Like the extension is trying to do its job but either there is a conflict with other extensions or vscode settings or that's how it works.
More specifically, I found the issue was caused by the the HTML, CSS, JS formatter extension.
Solution
If you have that extension, try disabling it and restart vscode. if the issue is fixed then you may leave it disabled or uninstall it. If it is not solved repeat the process with other extensions, especially those that format your code, until you find the culprit and remove it.
Also i got this type of issue.The solution is just disable your auto save it will work.
If you're an Angular developer, maybe consider disabling Angular Essentials Extension by "John Papa". Then restart VS Code.
That worked for me after several frustrations.

How to keep code-folding on save in Visual studio code

I am working on some fairly large files in Visual Studio code and to save time I fold away functions and scopes, that I do not want to see. Everytime I save, which I do fairly often just out of habit, all the folds expand again and the current position on screen changes.
Since the only settings I could find were:
"editor.folding": true,
"editor.showFoldingControls": "mouseover",
the question is: How can I keep my folds upon saving?
Thank you for bringing up the extensions Mark. It was indeed an extension: lonefy.vscode-js-css-html-formatter.
Once this was disabled, the folding kept its state after saving.
For me it was the prettier plugin :(
Here is the closed issue: https://github.com/prettier/prettier-vscode/issues/408.
At the moment, there doesn't seem to be a fix.
For anyone that comes across this like me, I didn't have prettier, sort-imports, or lonefy. I was able to resolve by updating the 'folding strategy' setting from 'auto' to 'indentation' and it kept my folds persistent through saving and particularly in my case deploying code using the Salesforce CLI extension.
https://code.visualstudio.com/api/language-extensions/language-configuration-guide#folding
Had the same issue and it turned out to be the sort-imports extension. Removing it fixed the issue.
For future reference, I found this in the settings and it fixes the problem for prettier.
"editor.formatOnSaveMode": "modificationsIfAvailable"