Revert/Reload all open files in Visual Studio Code? - visual-studio-code

I have been trying to figure this out, and cannot determine if it is possible or not.
Essentially, I commonly work with a VSCode window containing many files located on an external network drive (CIFS mount in Linux). When these files are changed "on-disk", they do not update in the editor until I switch focus to each file by changing the active editor tab. This means I have to switch tabs, wait for the update to process, and then repeat for all open tabs (could be 10 or 20 tabs).
Is there anyway to force all open editors to refresh or revert at once? That would ease my workflow a lot for examining differences between these open files on the fly. There's a command to "Revert File", but that only works on the open file, rather than all currently-opened ones. I've looked in the settings and browsed for an extension, but I can't find anything to accomplish this task.

Well, You can try to map the external network drive to local disk and give appropriate permission for read and write restriction.
If your computer has firewall or anti virus installed, then you must exclude vs access restriction from fw/av inspection.
Otherwise you can also improve your network adapter performance, associate to buffers, throughput, packet latency, etc.
Alternatively, you can use any source control, so your codes could be persist locally and could be synchronized from/to source control server.
Hope this could helps.

Related

How do I copy code from my computer into x3270 emulator?

I'm using x3270 on Ubuntu 16.04. The zOS does not have a good editor and having to write a lot of code and fixing it is a pain.
I want to write code on my computer and copy it into x3270 window.
Is there a way to do this?
x3270 is a blocked based terminal interface and can be used. The approach would be to cut and paste code. Since you mentioned z/OS I assume you are using the TSO and ISPF. ISPF Edit (Option 2 by default) allows for a Text Edit Command (TE) so you can cut and paste larger blocks of text.
When you press enter you will see. You can then position the cursor and paste the text.
Sorry, I just had some assembler source handy but as you can see you can paste a large block of code. Its cumbersome though.
Personally, this is more of a stop gap measure for edits of limited size. There are better solutions.
I personally use VSCode on my local machine. There is a plugin for VSCode from an open source project called Zowe that provides a plugin for VSCode in the VSCode marketplace Visual code Extension for Zowe. This is extension allows for editing code from z/OS on your local system (I use a MacBook Pro) and facilitates the file transfer for you. This is my preferred option. It does require that z/OSMF is installed and configured. You'll need to check that setup on your system.
The final option is to use SFTP to transfer the file. SFTP will allow transfer to MVS and USS file systems and provides an ASCII to EBCDIC conversion as well.
SCP will only transfer files to a USS based filesystem and is an option if that fits your needs.

Ignore backup files in chrome debugger source tab

I am using Chrome DevTools and have mapped my local source tree. As a result, when I look in the Filesystem tab in the Sources tab, I can see all of my source files and all of my backup files.
The backup files are pure clutter: is there a way to hide them from the view?
I am not talking about black boxing: that prevents me from stepping into files that are actually used. I want to not see files that are not used in the list of files.
I want model.jsx.~1~ to not show up in this case. In general, any file matching *~ should be hidden.
As reported in the comments, this is not currently possible. I created an issue to request the ability.
https://bugs.chromium.org/p/chromium/issues/detail?id=883325

Eclipse: How to backup and restore session (windows, views)?

Occasionally, my fingers are faster then my brain and accidentally close views or windows of my development environment (which is Eclipse Kepler). I usually have two windows of Eclipse running side by side with individual views configured in both of them. Unfortunately, as soon as I (unintentionally) close a view/window, I have to set it up again. E.g. the build files in my Ant view get lost, I have to reopen files and so on...
Generally speaking, are there any plug-ins or options you can recommend that can help me backup and restore sessions? I'm aware of the "Save perspective" feature, but it barely meets my needs.
To be more precise:
Is there any feature to make Eclipse request my confirmation, before a (top-level Eclipse) window is closed? - I rarely do uncontrolled clicks twice :-)
Is there any plugin to save and restore my current views (incl. build files in Ant view)?
Is there any plugin to save a set of open files I'm currently working on? Would be neat, if I could open several files on a single click and get working right away. I'm thinking of a session management, where I can switch between several sets of open files.
Just in case none of the above is available and I messed up again, are there any files I can copy from one workspace to another to restore my Eclipse setup (windows/views)?
Any hints are welcome.

Simple and easy to use tool for managing different versions of files

I want to manage different sets of file versions locally on a machine without using complex version control tools like TFS/Git/SVN...etc. here is my use case:
I have a Windows virtual machine that contains many xml, xslt, xsl, txt...etc. files, the virtual machine gets updated with every release of my product.
Often I need to analyze errors in this virtual machine, so I change many files and run the product and start analyzing, let us call these file changes FileChangeSet1.
based on the results above I need to change other files and maybe some of the files in FileChangeSet1 and do another test.
again based on the results, I need to change more files, eventually I end up with FileChangeSet1, FileChangeSet2...FileChangeSet(n)
I want to:
be able to switch between these file change sets easily and quickly, e.g. have a GUI that shows my my tree of FileChangeSets then click one of them and all files of that change are used.
create file change sets from other file change sets e.g. copy FileChangeSet1 in FileChangeSet2 and change only one file in set 2
I don't want to configure and install a complex version/source control system like TFS/Git/SVN where I have to create a database of all my files first.
Making snapshots of the virtual machine is not an option because it is extremely slow.
I think you would not have much advantage with version control tools even because they are made to version text files. For binary files, I think you would end up like managing several diffent copies of the binary files anyway (at least for older tools such as CVS and SVN).
If you are running in linux, you may want to use cmp/diff tools. Take a look on incremental diff and diff tools such as patchutils.
Consider also to create a checksum of huge files to avoid comparing them for nothing.
ps. also take a look on this - http://jojodiff.sourceforge.net/ - haven't tried but it seems simple to use and promising.
Mercurial is the right tool for me. With it I can solve my business case easily as follows:
Install mercurial on Windows, it integrates in the Windows file explorer.
Create a local version control mercurial database by right clicking my root folder.
Now I can open all my files under my root folder in different text editors e.g. notepad++ and modify these files.
When I want to save/remember a specific status I simply commit the files to mercurial by right clicking the root folder, I can provide a commit note.
Later I can change my files in a different way and test how my system reacts to them, again I can commit these files locally.
Over time I have a history of change sets in Mercurial, I can go back to any change set, branch it, merge it...etc.
I have a huge and complex system that contains thousands of files, my root folder is actually the C:\ drive, I can easily and quickly make out of c: a version control database using mercurial.
All with a simple and intuitive GUI, no command line learning needed.

Is there auto-syncing in netbeans for external changes

I know netbeans syncs the original files once I save, but if there is a file changed externally is there a way for netbeans to recognize this and either tell me to re-sync it or automatically resync it with the new changes?
Here's what makes this behavior possible:
NetBeans 6.9 contains a feature that automatically looks for external changes to keep informations about files up-to-date. We have some reports that it can slow down NetBeans mainly, when an open project has many folders. When NetBeans find out that files were externally changed, it re-scans the files to keep data up-to-date that are used with features like code completion, navigation etc. Unfortunately the notification and following re-scanning can take some time and during this time many mentioned features are waiting for the finishing of scanning. There is option Enable auto-scanning of sources that can switch off this behavior. The option you can find it in Options dialog, Miscellaneous category and Files tab.
The default behavior is that NetBeans also looks for external changes when the main window gets focus. This is can be during developing a web application very often when user switches between browser and IDE. The mentioned option also switch this off.
When you switch off option Enable auto-scanning of sources you can still keep the information up-to-date, just invoke Scan for External Changes action from Sources menu manually.
(Here's the original article by Petr Pisl)
I find it counterproductive to leave this setting on, as sometimes auto-loading external changes to a file opened in the UI without asking for permission first can ruin your day when you're forced to make small local changes that you don't want replicated in your repository. I'm sure other people can think of more reasons to advocate for "warn before loading external changes" behavior to be implemented in NB. That is one of the reasons why I like Eclipse better sometimes.