VSCode editor not marking changes - visual-studio-code

I noticed that the VSCode editor sometimes mark/track changes (https://imgur.com/a/u4U2tdc where there's a blue mark next to line 16 to indicate a change) and sometimes it doesn't, and today it's not tracking changes for some reasons, and I am not sure what's causing the issue.
Could someone advise how to debug this issue?

This is controlled by the setting scm.diffDecorations. By default, it should be set to all:
Check this setting. Additionally, new files that you just added can't show these differences, because it (Git) has nothing to compare it to yet. The same can be said for untracked files.

Related

How to change VS Code's merge conflict layout?

I use VS CODE for version control (using git).
Every time I had a conflict, VS CODE showed me with a layout where I could see all the changes in one window:
However, with no advice, it change to a weird 3 windowed design where I can't understand anything.
Does someone know how can I go back to the first design?
Go to VS Code settings
Untick the Git: Merge Editor setting
Now you should be able to see the previous merge layout.
This feature (3 way merge editor) can be enabled by setting git.mergeEditor to true and will be enabled by default in future releases.
You can set it back to false to go back to the previous design as you want.
This new 3-way merge editor seems to have a terrible UX issue. For me simply switching to merge editor to 'false' doesn't work as below:
git.mergeEditor = false
After this editor completely stopped showing me any merge conflict line.
I have to finally do like this to revert back to original merge conflict view.
"diffEditor.codeLens": true,
"git.mergeEditor": false
Hit ctrl+shift+p to open command pallet and open the settings json by typing Preferences: Open User Settings (JSON) (or start typing 'settings' and this will come up)
In the main JSON object add "git.mergeEditor": false (insert comma beforehand if needed)
Hit ctrl+shift+p and type Developer: Reload Window to reload the windo.
The old type of merge editor should be back.. but you may need to wait a minute to get the full UI back (on my machine, the accept incoming buttons etc. didn't come back for a little).
Update 2023 in case the conflict UI has crashed/not displayed
When you rebase a file with embedded conflicts within conflicts VScode's in- file-conflict-display(blue/green UI) might glitch due to too-many git markers present, rendering merge impossible without CLI.
Apply workaround by enabling and switching to 3 way conflicts window.
enable merge editor (by searching the settings or modifying vscode config file locally)
use vscode's merge display by going to Source Control tab then clic the file with ! exclamation mark before the name of the file
solve the maximum number of conflict using the new 3 windows conflict UI (remember current and incoming are inverted in case of rebasing)
go back to normal file UI and the classic in-file-conflict-UI (green/blue) should be back online
finally git add . && git rebase --continue && :wq (vim) in case of rebase to pass to the next commit to handle.
Rule of Thumb: Remember to always create a temporary local branch of your feature before merging/rebasing your feature branch before PR. This will be used as backup to keep the design intent in mind. Then always run code(and lint) to check for obvious typos/merge artifacts (ie these git flags or unclosed loops/functions).

Visual Studio Code Save All button issue

Visual Studio Code Save All button is always enabled even without any file changes. How can we solve this issue? Ideally it should be grayed Out if no file changes are there in the workspace.
It's an intentional feature, just in case someone is not sure if they saved their files, VS Code will always show it to prevent closing without saving (besides the exit prompt).
Now, if for some reason they decided to change this, it would we worse, as people are used to the always blue button.

How can I get VS Code to give a heads up when deleting a file?

I accidentally deleted a whole project without commiting but the thing is that VS Code doesn't give me a confirmation prompt when deleting a file/folder.
Is there a way to get a heads up when I'm about to delete something? Thanks.
Use the setting "explorer.confirmDelete": true,, this will prompt a confirmation screen.
Another setting that helps my sanity in this situation.
"files.enableTrash": true, will move files to the OS trash instead of permanently deleting. This way you can go digging through the trash when this happens.
There is also
"workbench.editor.closeOnFileDelete": false which will keep open files that were deleted in the editor. A nice secondary option when deleting something.
"workbench.editor.closeOnFileDelete": false which will keep open files that were deleted in the editor. A nice secondary option when deleting something.
Make sure to use VSCode 1.75+ (Jan. 2023): issue 126144 ("Do not close tabs when a file is deleted when tab is not loaded") has been fixed with commit 0a11eb and is available in VSCode Insiders today.
That way, you can switch branch without VSCode closing files without warning.

Files in a folder are highlighted green with a number 1 next to them. What does this signify?

Yesterday a few files in one of my folders(git repository) have turned green and have a number next to them like so:
Can anybody tell me what this means? The repository is synced and up to date and that was the only possible thing I could assume it meant.
Thanks!
Those are the file explorer's problem decorations. They use colors and indicators to show which files have problems associated with them. The green here indicates there is a warning in the file, and the 1 indicates that there is one warning.
You can disable these by setting: "problems.decorations.enabled": false
This works well if you are using git. Doing a simple commit to your repo will take the warnings away.
I am using SVN external to VS code for a project and it became quite frustrating seeing files with issues and 'untracked'.
If anyone else in in this boat, set "git.enabled": false in your vs code workspace settings.
I've been searching for this. I've finally figured out the answer.
Go to File>Preferences>Settings (also ctrl + ,)
Go tot he "Workspace" tab > Git. Set Decorations Enabled: Off

ECLIPSE Subclipse: Occasional error with file selection in synchronize view

I am using Eclipse JUNO with the subclipse plugin.
Generally it works quite well. To commit files to the SVN repository you synchronize to check the changes you have made. Select the files you want to commit, add a comment and simply commit it.
Usually the selected files are then properly committed.
However, sometimes the selected files view in the commit window do not correspond to the actually selected files in the synchronize view. Instead it simply indicates all files in the project's file directory.
If you don't notice and commit you end up committing dozens of files/directories you do not want or need to commit.
I have tried all sorts of things to try and make it do that so that I know which chain of actions triggers it so I can avoid it but of course it never does it when you try.
Does anyone have any suggestions as to what might be causing it or experienced the same? It is definitely not that the selected files are no longer selected. I could clearly see that selection still being active on the left hand side synchronization view but still the commit window was showing a full file selection.
Any help/suggestion much appreciated.
I finally figured it out. Whatever file selection you do is overridden by a folder selection at a higher level => if you accidentally mark the project's main folder all files are transferred.
In the end it is Very simple and logical. The only nuisance is that the specific files you selected at a lower level are highlighted in the commit window's file selection view as well so if you look at the view superficially you get the impression only your selected files will be committed.