Skip to content

feature: application run profile support #110

Closed

Description

@s1n7ax

Requirement:

  • User should be able to create a run profile/profiles
  • User should be able to pick and run using a run profile
  • In a profile, user should be able to include project specific information

@todo we should look into how and what information intelij stores
@todo we should look into if we can do run and debug both
@todo we should look into if overseer can be used on things like this

Activity

  1. converted this from a draft issue on Jan 10, 2024
  2. atm1020 commented on Mar 10, 2024

    @atm1020
    Contributor

    @s1n7ax

    1. IntelliJ creates a workspace.xml file in the {project_directory}/.idea folder, where it stores profile information. As an example, I've set up a configuration with VM arguments and program arguments ( I believe these are the most commonly used settings, so I've focused on them in the nvim options as well) .
      image

    2. it's possible to pass VM and program arguments for both running and debugging. For the debugging option, after selecting a new profile, you need to reconfigure DAP to load the new arguments. One little downside is that if you're running an application with profile1 and you switch to profile2, you need to stop the session and start a new one to use the profile2.

    3. I think overseer little overhead in this case, because the run/debug commands are already available for us, and simpler user interface is better for profile changes and creation.

    POC:

    Since nvim.nui is already in use, I focused on creating a small UI with it for creating, editing, and changing the active profile.

    profile.mp4

    Profile ui

    • Open with JavaProfile command
    • Create Profile
      • Select the new profile option to create a new one (press enter/space)
      • Press s in normal mode to save.
      • The new profile is set active by defult.
    • Update
      • Select profile to edit (press enter/space)
      • Press s in normal mode to save.
    • Set Active
      • Press a in normal mode in a list

    All Key binding (in normal mode) :

    • Profile List:
      • j: Down
      • k: Up
      • space: Edit
      • enter: Edit
      • b: Quit/Back
      • q: Quit
      • a: Set Active
      • d: Delete
    • Profile Edit:
      • b: Back
      • q: Quit
      • s: Save

    The profile config is saved to a JSON file named nvim-java-profiles.json in the ~/.local/share/nvim folder. Saving to the project folder to the .config.json file or something like that, similar to what IntelliJ does, is still a possible option, but for dev/testing, one config feels more manageable.

    json structure:

    {
     "project_folder": {
        "profile_name1": {
          "vm_arg": "Vm-arg",
          "prog_arg": "Prog-arg",    
          "profile_name": "profile_name1"
     }
    }
    
  3. moved this to In Progress in Java for Neovimon Mar 24, 2024
  4. added a commit that references this issue on Apr 12, 2024
  5. s1n7ax commented on Apr 12, 2024

    @s1n7ax
    MemberAuthor

    Awesome work @atm1020. Thanks for contributing.

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions