Skip to content

Document Groups don't import correctly #6588

Open

Description

@MichalGasparovic

Apache NetBeans version

Apache NetBeans 19

What happened

When importing the settings, all document groups are transferred correctly, but the documents themselves are not. I have been registering the problem since version 17.

How to reproduce

No response

Did this work correctly in an earlier version?

Apache NetBeans 17

Operating System

linux

JDK

openjdk version "11.0.20.1" 2023-08-24 OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04) OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Activity

  1. added
    kind:bug
    needs:triage
    on Oct 19, 2023
  2. mbien commented on Nov 4, 2023

    @mbien
    Member

    I am not quite sure what you mean by "document groups"

  3. neilcsmith-net commented on Nov 4, 2023

    @neilcsmith-net
    Member

    @mbien it's under the Window menu. Although I'm unclear exactly the issue? That the group names themselves are migrated, but that the documents they refer to are not?

  4. mbien commented on Nov 4, 2023

    @mbien
    Member

    @neilcsmith-net wow, didn't even know that this existed

  5. neilcsmith-net commented on Nov 4, 2023

    @neilcsmith-net
    Member

    OK, just set up some groups in NB19, then imported settings into NB20-rc3. Group names are there, but they have no documents included.

    @neilcsmith-net wow, didn't even know that this existed

    I've never used it to be honest, unlike project groups which kind of fulfil that requirement for me.

  6. added
    Platform
    and removed
    needs:triage
    on Nov 4, 2023
  7. mbien commented on Nov 4, 2023

    @mbien
    Member

    you know... this looks quite useful! One thing is missing: if switching to the group "none" would automatically stash the last group into "stashed group", so that you can switch back when you are done.

  8. neilcsmith-net commented on Nov 4, 2023

    @neilcsmith-net
    Member

    Looks related to something @lkishalmi brought up a while back on importing window configuration. There's a DocumentGroups folder in <userdir>/config that contains the group configuration and window modes, which are copied across, but window settings files (hence document references) that are not. I'm not sure if it's a good idea to bring those across as is though?

    EDIT: I also deleted the DocumentGroups folder and restarted NB19, and the group names still showed up, so it might be somewhere else they're stored that is being imported.

  9. changed the title [-]Document Groups[/-] [+]Document Groups don't import correctly[/+] on Nov 4, 2023
  10. jroman commented on Apr 16, 2024

    @jroman

    Any hope for advance in this bug?

    I came to this thread from a collateral effect. After upgrading from v20 to v21 I had my settings imported when opening for the first time, but the editor tabs I have open in v20 were not open in v21 (editor was plain empty).

    I tried creating a "Document group" in v20, and the group is available in v21, but the editor opens empty again and if I open the Document group nothing happens.

    I see that "Document group" functionality is worth evaluating for the day to day, but for now I just wanted to move from v20 to v21 and keeping in v21 the same editor tabs I had (and still have) in v20

    Any other idea for starting v21 with the same open files as I have in v20?

    Thanks in advance.

  11. mbien commented on Apr 16, 2024

    @mbien
    Member

    @jroman opened files are currently not imported since those are part of regular UI persistence which has no compatibility promises between versions.

    You can try to replace the config manually:
    it would be in [netbeans_user_config]/[version]/config/Windows2Local/*
    this usually works but there are no guarantees.

    I tried to look into this a few times already but always got distracted by code cleanups (#7155) since the part of the codebase is ancient and had several other issues with higher priority (e.g #6094, #6559), but we are going to get to this one day - I would like to see this too.

  12. mbien commented on Apr 17, 2024

    @mbien
    Member

    ran a few experiments:
    letting NB auto import config/Windows2Local/.* (or a subset of it) would break things since NB would try to deserialize UI components before the right clusters are active, this will open the tabs but the state is inconsistent (it will also throw exceptions).

    what seems to work a bit better is:

    • let NB import the settings and close NB again
    • copy Windows2Local
    • start NB a second time

    since this makes sure that the right clusters are active before the deserialization begins.

  13. jroman commented on Apr 17, 2024

    @jroman

    Thanks for your reply!

    That worked for me. I hope there is no incompatibility with the config files...

  14. neilcsmith-net commented on Apr 17, 2024

    @neilcsmith-net
    Member

    @mbien it might be better to look at storing as a set of URI instead, similar to parts of the project group support. Possibly even hide the document groups from the UI and just support project grouping?

  15. mbien commented on Apr 17, 2024

    @mbien
    Member

    @neilcsmith-net I believe this wouldn't work properly, since it wouldn't be able to create the project group/doc group -> files associations. If would open the files but if you switch pg or dg it wouldn't do anything.

  16. mbien commented on Jun 1, 2024

    @mbien
    Member

    I just noticed while testing that ant projects seem to store a file list per project group directly in the project folder in nbproject/private/private.xml

    its interesting to me that different project types have different ways how to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EditorPlatformkind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions