Skip to content
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

Allow opening a different project #241

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Cuperino
Copy link
Member

@Cuperino Cuperino commented Feb 6, 2025

Opening a new project closes all files and replaces the current project.

@Cuperino Cuperino added the ⬆️ feature New feature or request label Feb 6, 2025
@Cuperino Cuperino requested a review from narnaud February 6, 2025 01:53
@Cuperino Cuperino self-assigned this Feb 6, 2025
@Cuperino Cuperino force-pushed the open-projects branch 2 times, most recently from 8ae1839 to 843a57e Compare February 6, 2025 02:16
Copy link
Member

@narnaud narnaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see multiple issues here.

On the form:

  • there are 2 commits together, one is the close tab that I don't want
  • you are not using conventional commit

On the code itself, changing the Project root multiple times is a bit more involved, as project settings are loaded in Project::setRoot.
Also it will require to stop and restart the LSP clients...

I'm not sure it's super important to be able to open multiple projects. If you want to continue in this direction, go ahead, but there's more work than that.
Otherwise close the PR.

@Cuperino Cuperino force-pushed the open-projects branch 2 times, most recently from ac2de57 to 6074fe4 Compare March 3, 2025 21:08
Cuperino added 3 commits March 3, 2025 17:23
Opening a new project closes and replaces the current project.
Saving only takes place if it's applicable.
Saving only takes place if it's applicable.
@Cuperino
Copy link
Member Author

Cuperino commented Mar 3, 2025

there are 2 commits together, one is the close tab that I don't want

This was intentional because the changes in feat: allow opening a different project depended on the changes done to the closeDocument function in feat: make document tabs easily closable via mouse. I didn't plan on merging this PR until the one with those changes had been merged.

What I've done here now is duplicate the code in each PR, so they can be merged individually in any order. Whichever PR is to be merged after will have to be re-based and have its conflicts resolved. This isn't a big deal, but it's what I was trying to avoid.

you are not using conventional commit

Fixed.

On the code itself, changing the Project root multiple times is a bit more involved, as project settings are loaded in Project::setRoot.

Fixed by saving settings if settings would've been saved when closing the app, and then reloading all settings in order so everything's anew.

Also it will require to stop and restart the LSP clients...

Done. Tho I'm not sure of how to properly test this...

@Cuperino Cuperino requested a review from narnaud March 3, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants