-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workspace management #92
Conversation
@Val95240 Sorry for the late reply. I read it on mobile and have totally forgotten to reply later when I went back to my desktop. While I really love the idea of workspace management here. But it is a huge change in the code base and it makes merging the PR difficult. It would be nice if you could keep the number of changes minimal. |
What OS have you tested. This looks like a nice feature |
Sorry I didn't have much time these last months to work on that. @randy3k I understand your concern, it's true that I had to change quite a bit of the code base, but as I said, I tried to copy your code base as much as possible to mitigate this. So for example the new methods @TheSecEng I tested the feature on Linux (Ubuntu 18.04 and 20.04) and Windows 10, but not on Mac OS as I don't have an easy access to this OS. However, the modifications I added should be OS independent as I only built on the existing base code which seems to work everywhere. Feel free to test the feature on other OS if you have the opportunity ! |
@Val95240, I tried to clone your repo in order to test it out. I could not get is work with my projects saved in Just to be clear: I cannot open BTW, I am on Fedora 32, ST3 3211, should that matter. |
@tukusejssirs It's difficult to say what could have gone wrong in your case, but my main theory is that the file that contains your recently opened projects By the way, you don't have to clone the repository to install the package, you can call |
@Val95240, thanks for your answer! It still does not work. As for adding repo to Package Manager, I tried that before posting my first comment and even now. It works only when I remove the original/upstream (randy3k’s) version. On the other hand, I prefer installing such repos manually (I prefer updating them manually too). → Therefore, IMHO it is not easier, at least not for me. When I find a bit more time, I’ll try your fork on a clean ST3. |
Hey ! |
@Val95240, the console log contains the following error when I click on Projects → Project Manager → Project Manager: Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 1052, in run_
return self.run()
File "/home/ts/.config/sublime-text-3/Packages/prman_val95240/project_manager.py", line 1030, in run
self.manager = Manager(self.window)
File "/home/ts/.config/sublime-text-3/Packages/prman_val95240/project_manager.py", line 141, in __init__
if self.reorganize_files(self.projects_path):
File "/home/ts/.config/sublime-text-3/Packages/prman_val95240/project_manager.py", line 196, in reorganize_files
os.mkdir(directory)
FileExistsError: [Errno 17] File exists: '/home/ts/.config/sublime-text-3/Packages/User/Projects/ts' After seeing that, I removed Note that there is no error when using the upstearm version. I think that folder creation should not fail when it already exists. A mere warning would be enough if at all needed. |
@Val95240, now it works as expected. However, I kind of miss a way to change the worspaces within a project, that is:
|
Thanks for your feedback ! You're right, I didn't plan the case where the user already have a directory with the same name as a project in the To change workspace within a project, there's actually an
However, for these commands to do something, you must have several workspaces in your project already: you can create a new one by opening a project, and calling Project -> Project Manager -> Add New Workspace, or |
Note that I always have my projects in the |
Actually, the option to open a different workspace exists in the location you are describing (Projects → Project Manager → Project Manager), but the particularity is that it is available only if it could be applied, i.e. if the project has more than one workspace. Originally, with randy3k's default plugin, the From what you're describing, I think that the command Now, I hear your need of self organizing your
but you seem to have a different one (if I understood well). |
The structure is similar to to the one you presented, however, with two differences:
Note that I usually name a main project the same as the subfolder (e.g. |
I tried to test thoroughly the plugin with the same organisation of the I checked and in my case, the plugin works:
Moreover, if you have projects or workspaces directly in the main folder ( I'm not really sure what you can do to fix all your issues, my main advice would be to delete your entire Regarding your remark about printing the subfolder name in the list of projects, I just pushed a commit in that sense: now, in the example tree from above, the projects |
@Val95240, I’ve just tried you latest version. Below is described what exactly I did. The steps I took
I did not notice any project name in the statusbar yet. Do I have to enable them somehow? Note that I also create a project A suggestion: when/if you implement the project name output in the statusbar, I think it might be better to output the name of the workspace too, unless it is the default workspace; for example:
|
Okay I'm not sure but I think I found and fixed the issue. It was a small problem with the automatic closing of empty workspaces, and my guess is that it's the reason you sometimes saw windows appearing and disappearing instantly.
And in 8., your description of the
That's what I tried to explain in my previous message, a file
Regarding the status bar display, I didn't implement it yet, I only worked on the display of the names in the PM overlay list. However it could be interesting so I might work on that when I have the time, and I definitely will take your suggestions into account, thanks ! |
I confirm that the issue described in this comment of mine (removing files from workspaces and subsequently crashing ST3) is fixed in the latest commit of the downstream repo. I had to do the following:
Notes:
Well, this somewhat bugs me. I see you want to remove the of the subfolder ( Reasoning: I use the If you still require your current implementation, I suggest to add an option for this in the package settings. |
dbfaec3
to
d36df7d
Compare
d36df7d
to
52e9e85
Compare
Hey !
I needed to have workspace management for my projects, and I already used your plugin so I modified it to fulfill my needs. I changed a bit of code, but the basis is still the same.
I didn't document my modifications yet, but normally the name of the methods are pretty self-descriptive.
I don't know if you're interested in this feature, theoretically everything works fine and the tests have been successful until now, but I didn't test it on different OS (even if no features should be OS-dependant) so you may want to check on your side if you're interested in merging.
The features I added are : creation, opening, opening in a new window, renaming and removing of workspaces. By default, if only one workspace exists, everything works as before and the upgrade should be transparent for the user.
If you want more details about the modifications, feel free to ask !