-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix creating a new file or folder if the preferences widget is opened. #7302
Conversation
If no File or Folder is selected, then the new File | Folder should be created under the first root folder of the workspace, otherwise, the new File | Folder should be created under the selected folder. With a multi-root workspace, the new File or Folder can be created under the other root workspace if the focus is on the second root folder |
@lmcbout I'm not sure I understand your comment, when a |
If the preference setting is open and the tab is on "User" pref, the "New File | New Folder" crete it in th workspace, but when I select the Preference setting with the "workspace selected", it creates "New File | New Folder" under my /.theia folder which is outside the workspace. It just like you change the order of where the file is created |
It will create a new file/folder wherever the |
Sorry, it create it under <$Home>/.theia , not under the workspce/.theia |
I understood, untitled workspace ( |
I agree with you. When you open the preference settings , no other files, then creating a new "File | Folder" should be done in the first root folder |
6b8ded1
to
f432355
Compare
@lmcbout I have updated the code, if you can review. |
Fixes: eclipse-theia#7067 , eclipse-theia#7253 Initially we were unable to create a new file or folder while the user preferences was open. The user-preferences has the file scheme set as `user-storage` and we did not fall back to the workspace root URI and instead were getting the URI from 'user_storage:settings.json'. With this approach, we create files at certain directories and if a directory doesn't have the scheme set to 'file' it will fallback to the workspace root uri. Signed-off-by: Muhammad Anas Shahid <muhammad.shahid@ericsson.com>
f432355
to
ab3b9b8
Compare
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.
LGTM
anything else has to be done before merging? |
@akosyakov no, its complete imo. |
@lmcbout I think you can merge |
What it does
Fixes: #7067 , #7253
Initially we were unable to create a new file or folder while the user preferences was open.
The user-preferences has the file scheme set as
user-storage
and we did not fall back to the workspace root URI and instead were getting the URI fromuser_storage:settings.json
.With this approach, we create files at certain directories and if a directory doesn't have the scheme set to
file
it will fallback to the workspace root uri.Signed-off-by: Muhammad Anas Shahid muhammad.shahid@ericsson.com
How to test
Launch Theia
Open any workspace
Go to File>Settings> Open Preferences
Make sure you are on
user
tabTry creating a new file or folder from
File>New File
orFile> New Folder
.Review checklist
Reminder for reviewers