Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 'New Window' Command #9519
Add 'New Window' Command #9519
Changes from all commits
c0be505
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have mixed feelings about using this to solve the problem of opening without reloading the workspace.
Positive feelings:
Less positive feelings:
theia/packages/workspace/src/browser/workspace-service.ts
Lines 436 to 445 in 011f76e
So I'm not sure exactly which way is best, but I'd prefer to see one solution to the problem of not loading a workspace rather than two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi collin, do you have some ideas to implement this by using the WorkspaceService ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the end my complaint has more to do with misgivings about how we treat the URL bar (that we don't react to changes unless the user does a hard refresh, for example) than it does with your solution. In reality,
core
definitely does know what the hash is for (e.g.ElectronMainApplication.prototype.openWindowWithWorkspace()
sure knows), so using a specific hash for an empty workspace isn't a problem.Maybe change the
close
function in the workspace service to use the empty workspace fragment rather than usingsetMostRecentlyUsedWorkspace
dishonestly, and I'll be thoroughly satisfied 🙂. Sorry for the detour.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to bother you again, but when you say the empty workspace fragment do you mean the DEFAULT_WINDOW_HASH ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed, exactly. Sorry for the confusion in terminology. Mixing your
HASH
term and thewithFragment
method on URI's.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that I misunderstood something about what I have to change to the close method. For me, it is only used to clear the root by setting the most recent workspace uri to an empty string. Also, we use the empty hash value only to know when we are opening a default window and we are modifying the uri just after checking that condition with an empty string like it is shown in this picture :
![Capture](https://user-images.githubusercontent.com/83670327/121710088-360b6e00-caa7-11eb-9722-15bb6c467515.PNG)
If we modify the uri fragment with the hash value and let it like this, the root won't be clear anymore and a default window will not appear when we close the workspace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change means that we will not restore the previous workspace if we do the following:
example-electron
application