Package development for Sublime Text 2 with multiple files without restarting - plugins

I am developing a couple of packages for sublime text, and to avoid copy and pasting massive amounts of code I began to move my classes into separate files. I have been avoiding this so far, since, in my current workflow, changes to files that are not in the main plugin file won't get updated when saved and only go into effect when I restart sublime.
Is there a way to reload a package, including all it's files, without restarting Sublime Text?

You don't actually have to restart the editor. You will have to restructure your plugins though to take advantage of this. Essentially, you can load the plugin files from some top level file. As an example, take a look at Package Control. I also do it in PersistentRegexHighlight (though the package control solution is likely more robust (I did base it on that). Still not as good as simply saving a particular file, but better than restarting! In fact, you could probably tie into the on_post_save event to automatically save the top level file when you modify a child file.

I personally found the easiest solution was to install Package Reloader, and just put a new file in the top directory of my plugin named .build. Save your top-level plugin file and enjoy not having to restart.
Virtually no restructuring of code required.

From the unofficial docs:
Sublime Text will reload top-level Python modules from packages as they change (perhaps because you are editing a .py file). By contrast, Python subpackages won’t be reloaded automatically, and this can lead to confusion while you’re developing plugins. Generally speaking, it’s best to restart Sublime Text after you’ve made changes to plugin files, so all changes can take effect.
Unfortunately, plugins are not loaded into a scope visible from the console (Ctrl`), so you can't just reload() it. EDIT But, you can call reload() from within your top-level plugin file, as detailed in #skuroda's answer.
You'll have to make the decisions on when to break classes out into separate files vs. keeping them together in one monolithic collection. Having 50 files, each with only two or three function definitions is overkill in one direction, while having 20 classes each with 10 or 15 methods all in one file is going overboard in the other, so just do what feels best for the particular project. In my experience killing/restarting ST2 doesn't take too long in any of the supported operating systems (except on XP, for some reason...), so hopefully it's not too much of a delay on your workflow. One suggestion I'd give is to create a portable installation (if you're on Windows) with just the bare essentials in extra plugins if your startup time is too long.
Good luck!

Related

does a "fake folder structure" Extension exist in VSCode

As an avid user of processing in my spare time, I often find myself writing more than 10 classes in a project, which of course overflows the class bar at the top of the processing IDE and makes it hard to work on all the classes in a project. The solution in any other language is to create class libraries (.net), packages (java), etc. which is not possible from within the processing IDE (It just won't accept .pde files in subfolders).
I tried using Eclipse and importing processing but it makes everything a little more messy as you have to extend Papplet and pass it in to every class that you create and then you have to say parent.rect() or something similar when you want to use Papplet methods which is just one step more than I am willing to go on every new project.
Now, I often use processing from VSCode since i prefer the IDE and i can still compile and debug just as easy from VSCode as Processing IDE, and one day i thought to myself, what if, rather than that horrible solution of using Eclipse, I have the following:
All .pde files are in the one directory (just how processing wants it) but I have an extension for VSCode that takes my files and displays them as if they were in folders within VSCode, There are no changes to the file structure, only the way they are visible to me within the IDE, this way I can comfortably see each of my files and manage larger projects!
So the project folder would look like This in file explorer
But would look like This in VSCode
So finally, my question is -> Is there some sort of extension that I can get that will do this, if not, any suggestions on where i should start in creating one?

XPages: add a ResourceBundle Editor to the Domino Designer/Eclipse

I found this properties editor that seems perfect, I have a lot of translations to maintain. I found this editor that seems to be able to handle all languages at the same time, which is perfect for me: https://github.com/essiembre/eclipse-rbe
I managed to install the plugin, but now I have to confess that I'm way out of my league. Stumbling around in the dark...
How to start it, how to use it?
Or is there a better way to maintain properties in multiple languages?
I also have to maintain an application with a multi language user interface.
First of all I also started the attempt to use eclipse plugins for editing Java resource bundles but I am also failed... :(
After some test's with different editors I decided to work with JLokalize.
My way of proceeding:
Step (Switch to the package explorer of your Domino Designer)
Step (Select a folder for export to file system, e.g. Custom Controls or XPages)
Step (Set filter types to *.properties)
Step (Finish the export to your filesystem (or a network file share, if someone else should do the translation work))
Open and edit the resource files with JLokalize
After finishing your translation work you could import the translated files (e.g. *_en.properties for files translated to english) in your application.

Auto update changed paths like Dreamweaver, Possible in Sublime Text?

I recently started using Sublime Text 3, mostly for HTML and CSS and still learning the tricks.
In Dreamweaver, if I change a linked file/folder name or move it to different folder (within the project folder), it asks if all the html file containing those links should be updated and if confirmed it does updated the all the files in the project folder automatically, even the unopened files are updated! It saves a lot of time and errors.
This is the only feature I missed in Notepad++ when I used it for few projects.
Now, I am wondering if the above feature is there in Sublime Text (by default or with the help of some plug ins)?
I will greatly appreciate any helpful suggestion.
This feature is not present in Sublime by default, nor in any plugins of which I am aware, and although it is theoretically possible to write such a plugin it would be quite computationally intensive to have the feature "live". I find it much easier to keep CSS, JS, and markup in defined directories, and not move them around after creating them :)
You have to keep in mind that Notepad++ and Sublime Text are text editors, not IDEs, and so don't have all of the features of giant programs like Dreamweaver that are hundreds of times their size. Their primary purpose is editing and otherwise manipulating text, and ST at least (I'm not terribly familiar with N++) has a nice plugin API for writing functions to assist with that (such as inserting the path to a file), and people have even been able to write much more complex plugins to do things like linting and code intelligence, but things like keeping an eye on large groups of files and changing them all in response to certain events, or completely refactoring significant amounts of code, just isn't what it's designed for.

Are there any apps that save backup versions of a file with one click (save, commit, etc) live while editing?

Just something that will save changes automatically, while i'm editing say in gedit, or notepad plus plus, or even windows text editor, etc.
I can't seem to find exactly what I'm looking for and svn, bzr, and Git are too complicated. One should be able to start a new project, start writing code, and that's it!
So... I'm going to create a whole new version control system that will be more amazing and simple than all the rest! Unless something already exists? Whether it be online, or a local install, whatevs.
EDIT: Ok, the above paragraph was a bit absurd now that I read it much later. I use Git now, and Git is awesome.
Many text editors will create a backup copy of the prior version when you do a save.
Of course, this is pitiful compared to an actual version control system. You should know that many VCS integrate with editors so commits are very simple quick commands.
The minor time it takes to create a repository is insignificant compared to the time it will save you during the project.
Frankly, this sounds like an argument from ignorance.
I found this nice little Gedit plugin: http://nerdblog.pl/2009/06/01/save-and-commit-to-git-plugin-for-gedit-2-26ave/

Can ClearCase be setup to work in Edit Merge mode?

I have a bad fortune of using ClearCase with UCM at work. We try to find a way to get user experience smoother while using it. One of the main problems is that all files are read-only until checked out. This interferes with using IDEs and their refactoring capabilities. Unreserved checkout changes little as it still requires perform check out explicitly. Can Edit-Merge approach be somehow emulated? For example, can ClearCase somehow make unreserved checkout on file modification automatically and not impose read only mode on them?
The way we approach the interaction between:
refactoring operations
ClearCase
is to use an IDE with a good ClearCase plugin:
The only way to preserve the history for files is doing the refactoring through an IDE like Eclipse without checkouting the files first: The ClearCase plugin will 'cleartool move' the files from their old name to their new names and checkout/checkin them, preserving their history.
The other manual way is less ideal:
You isolate that operation in a snapshot view in which, just for this refactoring, we clear up the read-only bit from all the files (so they are all in "hijacked" state).
Once the refactoring is done, we use the result as a source to import in a dynamic view.
clearfimport -mirror.
You can use a dynamic view as the destination, but the end result is new files with no link to their former filename.
The main idea being: you don't refactor your code every 5 minutes or even every day, so , with the right tool, you could have an acceptable way of mitigating the file-centric nature of ClearCase.