What are the modified and untracked files? [duplicate] - visual-studio-code

This question already has answers here:
What are the U and M file markers in Visual Studio Code?
(4 answers)
Closed last year.
In VS Code, on the left side, is a file tree.
Some files are marked "M" and most are marked "U".
How do I change the files from "M" to "U" or vice-versa?
Which is correct or the norm?

You'll need to 'brush up' on Using Version Control in VS Code, Git support.
Visual Studio Code has integrated source control management (SCM) and includes Git support out-of-the-box.
Note: If you are new to Git, the git-scm website is a good place to start

Related

VSCode find multiple files by name [duplicate]

This question already has answers here:
How to filter files shown in Visual Studio Code?
(5 answers)
Closed 7 months ago.
I want to see a filtered list of all the files in my project that have a specific extension.
As Im using a Scala language the files have the extension ".scala", so i would like to see a filtered list of all the files with a ".scala" extension.
The following post shows some techniques but nothing showing how to achieve what I require.
How do I search for files in Visual Studio Code?
Based on #Mark response I enhanced my knowledge a bit further.
Here is the link to the Visual Studio Code website that explains it in more detail
https://code.visualstudio.com/docs/getstarted/userinterface#_filtering-the-document-tree
Summary
Click on the "Explorer" icon in Visual Studio Code.
Click on the "Explorer" panel background and type what you want to filter.
In my case i typed ".scala" and all other that did not have the scala extension were removed from view.
To remove the filter, simply click the cross next to the red text that represents what you typed as a filter.
The cross appears when you hover your mouse over the text.
As VonC mentioned in the comment, see also his answer at How to filter files shown in Visual Studio Code? in vscode v1.70 you should be able to filter the Explorer to show only files with a particular extension by typing .json for example into the new Find Widget for lists (the Explorer files is a list).
Demo:
Note that there is a json.txt file that is not shown if you begin the filter with the ..

Why isn't Visual Studio Code autoclosing parenthesis [duplicate]

This question already has answers here:
Auto closing brackets in visual-studio-code not working for Vue files
(5 answers)
Closed 1 year ago.
Whenever I open a parenthesis, VS Code is supposed to automatically close it but it's not doing that. I have not changed anything with my VS Code so I don't know why this would be happening.
Fix: Disable GitHub Copilot extension if you have it

Is there a VS Code shortcut that aligns/idents lines of code? [duplicate]

This question already has answers here:
How do you format code in Visual Studio Code (VSCode)?
(29 answers)
Closed 1 year ago.
I cannot find a shortcut that that aligns/idents lines of code in VS Code.
an example
what i want the shortcut to do
You can search for lonefy on vscode plugins and download it! Whenever you save the file it gets indented just like how you want.

How to merge files(differentiate) in visual studio code

I am using Visual studio code for angular2 application. The requirement is to merge files, so, I want to differentiate changes in two files as it happens in Netbeans IDE. Is there, any extensions available to achieve the task in visual studio code.
For e.g - Merging Two files by differentiating changes like below:-
Please suggest some solution.
abc.component.ts (located in project1)
abc <-- text for understanding purpose
def
abc.component.ts ( located in project2)
abc
I want to differentiate two component files and push changes in another like it happens in Netbeans IDE? Is there, any solution available for Visual studio code?
First using vscode natively with the git toolset
(Make sure to look on the second title as it's a better native way!)
This way may be available on older version of vscode too! Still a good thing to know! (even we should always run on the latest version! And vscode is always keeping getting better and better).
A native powerful and cool way is to use the git toolset within vscode! It still not the most fluid way! But if you are in a setup where you don't have anything else or time or resources to use anything else! Also as a requirement you need to have a git repo initiated! Here we go:
First we will use the change and diffing capability of the git tool set. And the steps go as bellow:
Commit all the current changes
once done: copy past the other file to diff on the place of the current one. And save.
Cool now in the git pallet you can see the file in changes list! Click on it and the diffing editor will show!
Bingo this is it! You can compare and make direct changment! The diffing will keep happening in real time. Note the current state is in the right. And you make changement there.
Here an illustration of direct modification for instance the part in the left is missing from the current file
And here another illustration (current have in plus)
Well to sum up! Git tool and diffing in vscode is so powerful! And all that one need! The only problem is the extra step of committing and cleaning after if desired!
Here some tips! If you want to have the commit history cleaner! Or not have a merge separate! You can remove the last commits from history as much as you need: Without hard reset and commit again a cleaner one!
git reset --soft HEAD~1
You can check
How to cancel a local git commit
Otherwise it can be ok with atomic commit and merge mention!
Also if what you need is to be able to keep a lot from the current file! You can copy the current elsewhere! past the other file to compare! commit ! and then past again the old one! You'll have the old in the right and as current (Not as described on the above) In such a scenario this work well! (Hacky a bit but you may need it).
Native way (direct open of the compare editor)
(May require the newer version of vscode)
open a file that you gonna compare
open the command pallet
CTRL + SHIFT + P
type file: compare
You can see the different possible ways! For a file we can choose compare active file with.
Then you choose the file! The file need to be within the project directory.
And then you choose a file and the compare editor will open
The above was tested on my brother computer on a new vscode installation. I wasn't sure at first if it was part of the core! And i just confirmed that it is. That too remove the need to the method above involving git! And it's the best native way to go with.
Vscode extensions
Here two extensions i suggest the first:
https://marketplace.visualstudio.com/items?itemName=jinsihou.diff-tool
Easy and simple! It add two elements to the right click menu:
In current file right click -> Select as first file for diff, select one again to view the diff results
select to compare and compare with select no more simple then that !
Another extension to check:
https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-diff
I prefer the first! As this one compare a lot to the native way. And having the control in the contextual menu is just great.
Out of vscode! Using other tools
A quick google search and you'll find a lot of tools!
https://meldmerge.org/
meld merge is cross platform and open source and nice!
in linux and debian:
sudo apt install meld
Otherwise you can check the long list here:
https://www.jotform.com/blog/25-useful-document-and-file-comparison-tools/
https://stackify.com/code-merge-tools/
There is too winMerge to mention (an open source project for windows)
https://winmerge.org/

Visual Studio Code Does Not Format .cs files

couple of weeks ago I installed Visual Studio Code on my Windows machine. It is lightweight and I love it. But there is one problem that drives me crazy. The program cannot format .cs files. If I open .Net Core project, there is no problem on formatting. I changed the language from bottom right to C# and saved the file locally still no success. Is there any way to format code in single .cs file? I know there is already an asked question here for this problem but the solutions does not apply if there is no project created.
Use the command pallet (crtl-shift-P), type "format" and select "format code". Assuming the extension for the current language supports that.
TypeScript does, but C# does not.
You could raise an issue (if one does not already exist).