microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.88k stars 29.17k forks source link

History is broken #185439

Closed delzey closed 1 year ago

delzey commented 1 year ago

Type: Bug

Backing out of code work (CTL+z) to reference point, reviewing code, No changes made, then (CTL+y) to get back to last edit loses code work. I miss this coming from Netbeans, Several other features too that you don't think about until they are not there. Like full history compare.

VS Code version: Code 1.79.1 (4cb974a7aed77a74c7813bdccd99ee0d04901215, 2023-06-12T16:14:05.102Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i9-11900KF @ 3.50GHz (16 x 3504)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|127.83GB (111.75GB free)| |Process Argv|--crash-reporter-id 77d04c98-f562-42de-a494-3659a07e60c9| |Screen Reader|no| |VM|0%|
Extensions (25) Extension|Author (truncated)|Version ---|---|--- codeigniter4-extension-pack|ade|0.0.1 codeigniter4-snippets|ade|0.1.1 save-typing|akh|0.1.0 vscode-icontheme-nomo-dark|be5|1.3.6 codeigniter4-snippets|ben|0.0.2 composer-php-vscode|DEV|1.34.13297 phptools-vscode|DEV|1.34.13297 profiler-php-vscode|DEV|1.34.13297 jquerysnippets|don|0.0.1 xml|Dot|2.5.1 EditorConfig|Edi|0.16.4 auto-rename-tag|for|0.1.10 netbeans-keybindings|gro|0.0.7 php-awesome-snippets|hak|1.1.3 bootstrap5-snippets|Han|1.2.5 jquery-snippets|Hri|1.0.0 icon-fonts|idl|2.5.4 better-js-syntax|jef|0.0.2 php-cs-fixer|jun|0.3.9 dotenv|mik|1.0.1 material-icon-theme|PKi|4.28.0 php-ci|sma|0.4.2 code-spell-checker|str|2.20.5 codeigniter-web-developer-pack|Sye|0.0.9 bootstrap-v4-snippets|Zac|1.1.3 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30610679 3biah626:30602489 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 a2ce3375:30757347 pythonfmttext:30731395 pythoncmvfstrcf:30756944 fixshowwlkth:30730052 pythongtdpath:30769146 dh2dc718:30763024 ```
vscodenpa commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.79.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

gjsjohnmurray commented 1 year ago

Have you explored the Timeline view?

delzey commented 1 year ago

Hi John - Yes, the Timeline does not go back that far on some of the files. Not sure why? Some files I see 6 days, others a week. More recent files edited, it only shows a few hours when the file was written to many times previously. Will renaming a file cause this problem? I have renamed a few files from (Example: pagescript to pageScript)

I am going to try that to see if it affects the file...

UPDATE

I can confirm renaming a file is shown correctly in the Timeline. ONLY if renamed using VS Code. The file was created and modified in VS Code May 20. Since then there have been many changes. In reviewing the current file, the latest history shows a small modification I did yesterday, and the fact that I renamed it twice today. Renaming the file in Explorer outside of VS Code is not shown. Expected behaviour I am sure. The file Timeline of edits for the past two days remain. The other edits from all of May/June are lost.

On Sat, Jun 17, 2023 at 11:43 AM John Murray @.***> wrote:

Have you explored the Timeline view?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/185439#issuecomment-1595802842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXKPMNPJ7J2CS7VAMLNRATXLXNCNANCNFSM6AAAAAAZKHP5CU . You are receiving this because you authored the thread.Message ID: @.***>

bpasero commented 1 year ago

We cannot track renames via our file watcher, so we record a delete+add and thus loose the history connection. But you can find entries from the local history to restore via this command:

image

You can search for any file there and bring up the full history.

delzey commented 1 year ago

Understood. This is still unrelated the file explained below. The file below was created by right click add file in VSC on May 20. Written to several times. When I made changes and edits on Jun 16, the history was not there. I again used VSC to modify the file, decided to back out all of the changes I did using CTL+Z, copied two lines, used CTL+Y to redo the changes, it only remembered half of the total. I checked file Timeline, showed the save, changes not there either.

I can repeat this behavior.

The file is a JavaScript file and I am prototyping a web app. I will make some changes, save, refresh the web page, repeat.

On Mon, Jun 19, 2023 at 3:32 AM Benjamin Pasero @.***> wrote:

We cannot track renames via our file watcher, so we record a delete+add. But you can find entries from the local history to restore via this command: [image: image] https://user-images.githubusercontent.com/900690/246773342-828bfea9-fac9-4d0f-b3e0-ff3dcafe8ce1.png

You can search for any file there and bring up the full history.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/185439#issuecomment-1596748465, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXKPMPFLETDL3TJLEMTI7TXMAFDJANCNFSM6AAAAAAZKHP5CU . You are receiving this because you authored the thread.Message ID: @.***>

bpasero commented 1 year ago

Well, the number of entries to local history is limited by settings:

image

In other words, the history is not unbounded.

vscodenpa commented 1 year ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!