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

Attempt at loading status.. #16

Merged
merged 4 commits into from
Mar 25, 2023
Merged

Attempt at loading status.. #16

merged 4 commits into from
Mar 25, 2023

Conversation

roobert
Copy link
Contributor

@roobert roobert commented Mar 18, 2023

Apologies for the formatting change - if you let me know which formatter/settings you use I can reformat the file!

@00sapo
Copy link
Contributor

00sapo commented Mar 19, 2023

Tested, and I needed to change all the require('CodeGPT') to require('codegpt')

My config:

  {
    "roobert/CodeGPT.nvim",
    branch = 'loading-status',
    config = function()
      -- optional configuration
      vim.g["codegpt_hooks"] = {
        request_started = function()
          print("CodeGPT is loading..")
        end,
        request_finished = function()
          print("CodeGPT has finished")
        end
      }
      lvim.builtin.lualine.on_config_done = function(lualine)
        local config = lualine.get_config()
        table.insert(config.sections.lualine_x, 1, { require("codegpt").status })
        lualine.setup(config)
      end
    end,
    -- lazy = false,
    -- priority = 1000,
    dependencies = {
      { "MunifTanjim/nui.nvim" },
      { "nvim-lua/plenary.nvim" },
      { "nvim-telescope/telescope.nvim" }
    }

  }

I'm not sure about the lazy and priority options...

@dpayne
Copy link
Owner

dpayne commented Mar 24, 2023

@roobert sorry for the delay, I really liked the idea but wanted to refactor it a bit. I pulled in your changes then add some changes on top here https://github.com/dpayne/CodeGPT.nvim/pull/20/files?w=1. Do you mind reviewing it to make sure it still covers your usecase and for any improvements you would want?

@dpayne dpayne merged commit 302ca14 into dpayne:master Mar 25, 2023
@roobert
Copy link
Contributor Author

roobert commented Mar 25, 2023

@roobert sorry for the delay, I really liked the idea but wanted to refactor it a bit. I pulled in your changes then add some changes on top here https://github.com/dpayne/CodeGPT.nvim/pull/20/files?w=1. Do you mind reviewing it to make sure it still covers your usecase and for any improvements you would want?

@dpayne - nice one, looks good! The reason for the unique IDs was if you wanted to have individual loading statuses for different requests but in retrospect I think it's probably overkill and your solution is much nicer. 👍

@id-b3
Copy link

id-b3 commented Mar 26, 2023

Is the loading status now implemented? I installed the plugin and it works well, but I don't see any loading/spinner status.

@dpayne
Copy link
Owner

dpayne commented Mar 26, 2023

you need to implement the hooks or use something like this https://github.com/dpayne/codegpt.nvim#lualine-status-component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants