Different indentation in VSCode in the same project - visual-studio-code

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

Related

Phantom line display in Visual Studio Code IDE

In VS Code I have a tab with a plain text file I use for scratch while working during the day. I place all kinds code, questions, TODO lists, etc in this file and will reference it from time to time. It's helpful for history purposes.
At any rate, this file has ballooned up to well over 46,000 lines over the years and I'm now seeing this odd phantom line being injected at my cursor. I am unable to select it or remove it. I thought it was being displayed as VS Codes way of letting me know that a software update was available but when checking that was not the case. This is what it phantom line looks like, it seems to contain a history of CSS classes used over the years which is odd.
If I restart VS Code it goes away for a little while but then reappears. I have a feeling it might be because of the number of lines or perhaps memory but can't say for certain.
Has anyone else seen this behavior? I've probably enabled some setting by mistake and have no idea how to disable it.
Any suggestions would be greatly appreciated. Thank you!
Turns out it was the HTML End Tag Labels plugin that was trying to auto complete some HTML that was somewhere within the 46k lines.
I would have thought by identifying the file as type Plain Text, the plug-in would ignore trying to close HTML tags (since its not an HTML file) but alas that's not the case.
Thank you Mark Ahrens for the tip!

Unity3D 2020 - VSCode - What happened to intellisense?

Overnight, any help I had for Unity3D in VSCode, i.e. intellisense, disappeared. And I get the sense, no pun intended, that I'm not the only one who's afflicted.
I've tried updating and reinstalling what I assumed VSCode needed to make Unity3D intellisense work. And have checked and re-checked settings, reinstalled VSCode package, in Unity3D.
I've worked through a few tutorials that claimed to address the issue.
What else does VSCode depend on to make this relationship work?
Thanks! Here's to hoping you've fixed this and your life has gotten easier!
Try going to Edit > Preferences > External Tools > Regenerate Project Files (This is because of a bug where the VS Code extension doesn't generate the project files correctly the first time, you can check it out here).
You'll need to be using the VS Code Editor Extension 1.2.0 (you can check which version you're using in the package manager) or later for that option to appear. Also if for whatever reason there are 2 .sln files in your project folder (I've had that happen before, though it's less likely), that also causes problems.
Ok. First, thanks to Lightning_A and Charleh!
The resolution to my specific circumstance was to install the VSCode extension "Unity Snippets Modified" https://github.com/with-heart/vscode-unity-snippets
I had been using https://github.com/kleber-swf/vscode-unity-code-snippets.
Perhaps it's just a matter of Kleber's extension, which is/was great, was broken upon updating Unity to 2020? I dunno and don't have the time to look into it, unfortunately.
Hopefully, my question, the answers I received, and my subsequent resolution saves others from the rabbit-hole I went down.
Again, thanks everyone!

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.

Visual Studio Code Space Errors

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.

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"