Skip to content

feature: Run an application with an active profile set #131

Closed

Description

@garrettkrohn

Did you check the docs?

  • I have read all the docs

Is your feature request related to a problem? Please describe.

I cannot figure out how to run an application with an active profile, as a result it cannot configure correctly and I have to do all of my debugging in Intellij instead of Neovim. I have looked around for a solution, but haven't been able to find one.

Describe the solution you'd like

It would be great to have a parameter available at setup to pass in an active profile name.

Describe alternatives you've considered

I've tried setting up an environment variables with no luck, and I've tried digging through your code to find where the configuration happens and I was unable to, my lua is very weak.

Additional context

Thank you so much for your work on this repo, I use it every day for work and it is fantastic!

Activity

  1. added a commit that references this issue on Apr 12, 2024
  2. s1n7ax commented on Apr 12, 2024

    @s1n7ax
    Member

    @garrettkrohn Now you can create profiles using JavaProfile command.

    https://github.com/nvim-java/nvim-java?tab=readme-ov-file#profiles

  3. garrettkrohn commented on Apr 14, 2024

    @garrettkrohn
    Author
    Screenshot 2024-04-13 at 8 55 34 PM Thank you for adding this! I'm getting this error when trying to run the `JavaProfile` command, I'll do some digging and see if I can figure out what the issue is.
  4. s1n7ax commented on Apr 14, 2024

    @s1n7ax
    Member

    @garrettkrohn Jdtls has some commands we can execute. This exact one being added by jdtls plugin we load. This basically means plugin has not loaded. You happened to have nvim-jdtls installed? If so remove that. I might be able to help you if you have the config on github

  5. garrettkrohn commented on Apr 14, 2024

    @garrettkrohn
    Author

    I don't have nvim-jdtls installed, but I have jdtls installed via mason. Here are my dotfiles: https://github.com/garrettkrohn/dotfiles

  6. s1n7ax commented on Apr 14, 2024

    @s1n7ax
    Member

    @garrettkrohn You somehow have to call java.setup() before jdtls.setup(). Try this.

    Delete this line where you setup jdtls LS.
    https://github.com/garrettkrohn/dotfiles/blob/b710efb164344a49fced0790c6e8766cda2b4d18/config/nvim/lua/config/lazy.lua#L320

    And paste it inside this function but after nvim-java setup
    https://github.com/garrettkrohn/dotfiles/blob/b710efb164344a49fced0790c6e8766cda2b4d18/config/nvim/lua/config/lazy.lua#L264-L266

    Should look as follows.

    ["jdtls"] = function()
        require("java").setup()
        require("lspconfig").jdtls.setup({})
    end,
  7. garrettkrohn commented on Apr 14, 2024

    @garrettkrohn
    Author

    @s1n7ax Thank you so much, I should have mentioned I use kickstart folder in that repository, but I was able to take what you said and get past the error, but doesn't look like the active profile is working. I have one set:
    Screenshot 2024-04-14 at 6 29 26 PM

    But when I run the debugger it says:
    No active profile set, falling back to 1 default profile: "default"

    Did I miss a step?

  8. garrettkrohn commented on Apr 14, 2024

    @garrettkrohn
    Author

    Please ignore the above comment, I did not have the VM Arguments set correctly. Thank you so much for your help and your work on this plugin!!

  9. s1n7ax commented on Apr 16, 2024

    @s1n7ax
    Member

    @garrettkrohn Is it safe to use the config as instruction to install nvim-java on kickstarter?

    {
      "nvim-java/nvim-java",
      dependencies = {
        "nvim-java/lua-async-await",
        "nvim-java/nvim-java-core",
        "nvim-java/nvim-java-test",
        "nvim-java/nvim-java-dap",
        "MunifTanjim/nui.nvim",
        "neovim/nvim-lspconfig",
        "mfussenegger/nvim-dap",
        {
          "williamboman/mason.nvim",
          opts = {
            registries = {
              "github:nvim-java/mason-registry",
              "github:mason-org/mason-registry",
            },
          },
        },
        {
          "williamboman/mason-lspconfig.nvim",
          opts = {
            handlers = {
              ["jdtls"] = function()
                require("java").setup()
                require("lspconfig").jdtls.setup({})
              end,
            },
          },
        },
      },
    }
  10. garrettkrohn commented on Apr 16, 2024

    @garrettkrohn
    Author

    @s1n7ax I believe so, looking through my config and I don't there there is anything other than what you have pasted above! Do you want me to add that to the readme in a pr?

  11. s1n7ax commented on Apr 16, 2024

    @s1n7ax
    Member

    @garrettkrohn We have lazyvim instruction in wiki and I have a link to that in readme. If you can do the same please go ahead.

    https://github.com/nvim-java/nvim-java/wiki

  12. garrettkrohn commented on Apr 18, 2024

    @garrettkrohn
    Author

    @s1n7ax Sorry, I tried to figure out how to edit the wiki and was unable to. I wish the Wiki was just a folder in the repo.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions