Closed DrByrnes closed 9 years ago
@DrByrnes , I didn't understand this statement: Is there any way to link a HaoIDE project to a Sublime Project, what's the difference between HaoIDE project and sublime project, actually, your all five SFDC projects are in the same workspace but not different project data.
I am confused on your question.
I'm not sure how to plainly say this - but switching the active HaoIDE project does not also switch the open folder in Sublime. Doesn't it make sense to do that? I can make a quick video explaining my thought if that helps... (or perhaps I'm just missing a simple setting somewhere...)
You are right about switching the active HaoIDE project does not also switch the open folder in Sublime, switch HaoIDE project has no connect with sublime switch, actually, I am not familiar with the sublime project switch feature, I need to check out the knowledge of it or you can tell me how to?
Video is better for me to understand what you want, thanks.
I personally have no knowledge on how to do this or if it's possible, sorry! But to add clarification, here's a quick video I made that might help. I'll apologize in advance - my microphone wasn't properly set up. Sound is clear, just very faint... (crank the volume!)
thanks,I will check it tomorrow.
I completely agree with DrByrnes. I do exactly the same thing as he described in his first comment. MavensMate does what he is describing. That plugin implements its own open project function and uses sublime project files. Also, it switches which credentials it uses for each project since they'll be different for each org/project you work on.
@rspurrell , thanks, I will try to copy this feature from mavensmate.
@DrByrnes , I tried to link HaoIDE project with sublime project,
sublime.focus_window()
API, so, it will have two duplicate windows for project A.focus_window
API, window B will have more and more duplicates.So I need to find some way to keep the open files when one open window is switched to again, otherwise, this feature will not be delivered.
@xjsender for "What [you] can do" sounds good. The new window with each project opened is the expected behavior. I would suggest that you consider that the user may already have a sublime project created, rather than have haoide create its own project. Personally, my project files exist in the same directory as the .config and src folders you create.
For your problems, are you able to detect that the project is already open? If so, I would prefer that you do nothing or alert that the project is already open since you can't focus the existing window. Again, personally, I know when I've already opened other projects and would never run into this issue (I just alt + tab).
@rspurrell , if I change it as above described, it will be a huge change on user experience, so, in order to keep the UI consist, I will try to add a setting to control whether use the old way to manage project or use this way.
Refer to Focus window in windows OS, however, OSX keeps original solution.
Is there a new setting or property somewhere that I should look for to utilize this?
@DrByrnes , upgrade the plugin to latest, switch project, you will see the salesforce project is linked with sublime project.
So there's no additional settings I need to insert/update on the toolingapi.sublime-settings file?
@DrByrnes , no, you didn't, just have a try, if you have any question, please leave message here.
Interesting, though the solution present false confidence.
Here's what I just experienced: I was active in my 'Partial' environment with my 'Parial' Sublime project/folder open, working like normal, no change.
Then i switch projects to 'Full' and a new Sublime window opens up, (leaving the original untouched) and it does properly open my 'Full' folder, which at first, seems great - but then I found upon closer inspection that the open 'Partial' window is now connected to full because there can only be one active HaoIDE project at a time. This is a big problem.
I don't want to solution this for you (or if it simply isn't feasible, that's fine) but I'm not a fan of multiple windows / projects open when in reality you can only have one active (or default as you've got it labeled) HaoIDE project at a time. I do think that adding a simple (optional) field to the toolingapi.sublime-settings 'projects' array that points to the Sublime project to be the cleanest / simplest solution.
In MavensMate I can have multiple windows open and each is connected to its own SF instance. I don't have to manually "switch project" to change my connection to connect my current focused window to the correct instance. I just alt-tab. Mavensmate uses a config folder to hold all of the session info for the open project which I'm sure is used to know the correct connection information no matter which window you've switched to. There is no need to select your connection.
Currently, the way it works for me is fine though. I just use the "switch project" command to open my other project window. This is almost exactly how I had to do it previously with "quick switch project"/"open recent" in sublime anyhow. But if I forget to use "switch project" and alt-tab instead, I still must use "switch project" to set the correct connection.
@DrByrnes , @rspurrell , I can get your point, actually, there is a similar issue #20 requested by @Xtremefaith, you all request to change the default projects
setting, however, if projects
is change, I will need to announce all user of this plugin to change their own user setting, I think, it's impossible.
Most of user of this plugin in china never submit issue or contribute to this plugin, they will never get announcement even if they saw the upgrade messages.
So do you have any another good idea but not change the default projects setting?
How about you add a new flag to the setting file, something along the lines of 'Use_Advanced_Project_Definition' (that defaults to false so those that aren't aware aren't bothered with it - and only when the user changes it to 'true' does it look for that setting in each project definition?
Side note: I tried to create a new project in Sublime just now after adding a new project definition (for a new client) and I couldn't. After clicking 'Create New Project', nothing happened and I see this in the Sublime console:
Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublimeplugin.py", line 535, in run return self.run() File "main in C:\Users\Byrnes\AppData\Roaming\Sublime Text 3\Installed Packages\haoide.sublime-package", line 2149, in run File "util in C:\Users\Byrnes\AppData\Roaming\Sublime Text 3\Installed Packages\haoide.sublime-package", line 2366, in add_project_to_workspace TypeError: argument of type 'NoneType' is not iterable
@DrByrnes , this is a new issue #22 which will be fixed at tonight.
@DrByrnes , many users are complaint about the linking, they just want to keep original feature, so, I added a new setting link_project_with_sublime_project
to control whether open a new window linking, if you want to use the already delivered feature, you should set it to true
.
Regarding to your suggestion, I will take into my consideration
This issue will be kept open until I get a comprehensive solution, thanks for you response.
With the 'link_project_with_sublime_project' set to false it's still automatically opening another folder, only it's doing it in the same window and causing havoc with the existing sublime project definition.
Can this flag prevent that altogether as well?
@DrByrnes , you don't want all projects appeared in the same sidebar?
Correct - if they are all there in the sidebar it taints the results of using 'Find in Files' as I get results I'm not interested in.
I also don't want all projects in the same side bar. That is part of my reason for supporting this enhancement request. Each sublime project should be open in a separate window and each would use its own SF instance credentials specific to that project. It is annoying when I have to instruct haoide to use different credentials when I move to another sublime project which is in another window. The credentials in use should be bound to the sublime project in use, not set globally as they are now.
Another thing I noticed is that now when I deploy from one org to another, even though I have
"switch_back_after_migration": true
in my settings file, my project / open folder also opens the target org/folder and leaves it open.
This is not ideal for reasons of memory consumption (the orgs I work with aren't small and I've seen Sublime CPU usage & memory spike significantly to the point it's unresponsive as it indexes the newly opened folder), performance and just isolation. When I'm working in one org, I like to know that's the only org I could possibly touch. When I CTRL+P to open a file (I prefer to keep the folder pane hidden) I need to be absolutely certain which file (form which org) I'm opening and isolation (one folder at a time) is the best guarantee.
Honestly if syncing a sublime project with a HaoIDE project isn't something that can happen, I'd prefer to go back to the method of manual opening and closing sublime projects & folders as it was in early April and prevent HaoIDE from doing that automatically.
@DrByrnes , ok, I will rollback this to before.
@DrByrnes , you mean after switch_project
, target folder should't be added to sidebar?
This is great, thanks @xjsender !
Not a bug - question / enhancement request:
I currently have 5 Salesforce orgs / HaoIDE projects defined that I toggle between and actively develop against, which means I also have 5 Sublime Projects. If I want to switch from org1 to org2 it's a two step process:
Is there any way to link a HaoIDE project to a Sublime Project so that when I change my active HaoIDE project it automatically closes the active sublime project and knows which other sublime project to open?