Indentation for files that don't have a registered formatter - visual-studio-code

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.

Related

VSCode IDE messes up RTL strings after selecting

Recently, I had to reinstall windows 11 on my machine. So, after that, I had to install VSCode again (therefore, I have the most recent version of VSCode).
Now, whenever I select any Persian sentences (strings) in my code, the IDE shows a messed-up string that is far away from the correct one. I can not show the correct and incorrect sentences as texts here because copying and pasting results in the correct format. Therefore, I have to provide them as images. (Sorry for any inconvenience, in advance)
Correct Persian Sentence
Incorrect Persian Sentence (After selecting)
This might be a little bit tricky to understand for people who are not familiar with the Persian Language. The difference can be understood by looking at the first word after $creatorId in both images.
This also might happen if we wanted to write in Arabic or other right-to-left languages.
It would be highly appreciated if you could suggest anything to avoid this.
After searching a lot, I found the proper answer on one of the VScode repository's issues. The problem was with the way the new version of VSCode renders the whitespace. So, to solve this problem, you need to follow the below steps:
Open VSCode command pallete by CTRL + SHIFT + p
Search for Open Settings (JSON) and click on it. It should open a JSON file named setting.
In this JSON file, add a key named editor.renderWhitespace and assign on of the following values to it: boundary, trailing or none. Your JSON file should look something like this:
{
"editor.renderWhitespace":"boundary"
}
The weird messed-up string is disapeared now.
Note
You can also access and change the editor.renderWhitespace using the settings editor. So, if you find the steps mentioned above frustrating, just use the settings editor (you can open it using the setting icon at the right end of the VSCode window or even using CTRL + ,) and search for editor.renderWhitespace. Then choose one of the three above-mentioned options.

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.

VISUAL STUDIO CODE Toggle Line Comment not WORKING ANNOYING

Would be great if you can help with the following.
I find Visual Studio Code a good product for my software development needs. However, for me it is completely useless because the toggle line comment never works. I have installed the intellJ Idea keybindings cause I am too accustomed to it but Code studio rejects simple toggle line comment. What is worse, I am able to comment the line but with Ctrl+, whereas I expect that it should work with Ctrl+/ or the one defined with extension CTRL+NumpadDivide..... Also since Ctrl+\ is linked to split window it is a mess for me.
The json keybindings file is empty. I deleted everything there. I am Using Ubuntu 20.04, However my keyboard, because I changed it is Latin American Spanish..... I don't remeber that this key binding has ever worked when I had English Keyboard
Thanks

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 - File Explorer / Explorer change case

Sorry if the question is bit silly, but on Ubuntu 16.4 I am trying out code editors for Angular 2. VS Code appeals because of TypeScript. But when I open a location the directory name in File Explorer is in ALL CAPS even though I don't use CAPS in directory names? Googling didn't help. Perhaps I am missing something.
How can I change it show my directory name exactly as it is in Ubuntu please? I have tried to look into settings.json etc but no joy.
Cheers.
if you mean this (see the image below), that would be a standard behaviour and has nothing to do with actual size of the letters. As far as I can tell, you cannot change this.
Well I went to GitHub as suggested but they have sadly declined (click) to do anything about this as some "as designed" thing, whatever that means. Pretty bad, but okay whatever.
Use this to customise. https://gist.github.com/Hendrixer/7a250a2be529cda8939de8305c9a85a1
It's just another chromium based renderer. Open developer console and customise anything you like.