GithubHelp home page GithubHelp logo

Comments (5)

roobert avatar roobert commented on July 30, 2024 2

Hey, I had an initial go at adding loading status to the plugin - #16

The idea is to insert a random ID into a table everytime the plugin is executed, that way if multiple executions are made, Loading is still displayed until the last callback has completed. This could also be used to display the number of running executions in the statusbar, or something.

I load this into the lualine statusline with:

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

Note that you will need to load CodeGPT with a high priority to load before lualine, e.g:

	{
		"dpayne/CodeGPT.nvim",
		lazy = false,
		priority = 100000,
		dependencies = {
			"MunifTanjim/nui.nvim",
		},
	},

I've also added rudimentary support for hooks, you can test with:

vim.g["codegpt_hooks"] = {
  request_started = function() 
    print("CodeGPT is loading..")
  end,

  request_finished = function()
    print("CodeGPT has finished")
  end
}

from codegpt.nvim.

dpayne avatar dpayne commented on July 30, 2024 1

This is a good idea. I will try to work on adding it when I get a chance (pull requests are always welcome : )

from codegpt.nvim.

dpayne avatar dpayne commented on July 30, 2024 1

done with this PR 9b9e02a

from codegpt.nvim.

00sapo avatar 00sapo commented on July 30, 2024

Tested and for me it works, but after modifications (see my comments in the pull request for adjusting it)

from codegpt.nvim.

carlosflorencio avatar carlosflorencio commented on July 30, 2024

Thanks @dpayne !

from codegpt.nvim.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.