Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Features compared to cursor editor #34

Closed
RobertBrunhage opened this issue Jul 28, 2024 · 4 comments
Closed

Features compared to cursor editor #34

RobertBrunhage opened this issue Jul 28, 2024 · 4 comments

Comments

@RobertBrunhage
Copy link

I've been evaluating the cursor editor to know what was usable and not and there are a couple of things (some are implemented and some are not).

Below is a table of some of the features I saw myself using either from time to time or often. Not sure if there are any plans to support these different features but thought I would add it anyway. Also, there might be a way to do this already with Parrot that I am just not aware of!

Feature Cursor Parrot
Visual select and ask question to change/implement ✅ cmd+k
Ask a question around the current file ✅ cmd+l Kinda (you have to copy the entire file content and ask with that context)
Full context search (uses the entire context of the project and ask a question) ✅ cmd+l then cmd+enter when asking
@frankroeder
Copy link
Owner

Hi @RobertBrunhage, thanks for this overview!

  1. Visual select and ask question to change/implement: With PrtRewrite, we can do it inline, or with PrtChatNew, we can open the selection in a new chat.
  2. Ask a question around the current file: You don't have to copy the entire file. This is where we have the templates for: Templates Documentation. They can automatically paste the whole buffer content into a query (see example hook below)
  3. Full context search (uses the entire context of the project and ask a question): Yes, we are working on that in [suggestion] Ask for additional buffer context via user input #19. However, we are not planning to send your entire project to the API, only explicitly selected files (fzf makes this easy).

I have added a hook to your previous configuration that allows you to ask questions about the current file content using PrtAskFile.

{
  "frankroeder/parrot.nvim",
  tag = "v0.3.7",
  dependencies = { "ibhagwan/fzf-lua", "nvim-lua/plenary.nvim" },
  config = function()
    require("parrot").setup {
      providers = {
        anthropic = {
          api_key = os.getenv "ANTHROPIC_API_KEY",
        },
      },
      hooks = {
        AskFile = function(parrot, params)
          local template = [[
		      I want you to simply answer questions about the content of the provided file.
		      Questions:
		      {{command}}

		      Provided file content: {{filecontent}}
		      ]]
          local agent = parrot.get_command_agent()
          parrot.logger.info("Asking agent: " .. vim.inspect(agent.name))
          parrot.Prompt(
            params,
            parrot.ui.Target.popup,
            "🤖 Ask ~ ",
            agent.model,
            template,
            "",
            agent.provider
          )
        end,
      },
    }
  end,
}

@RobertBrunhage
Copy link
Author

RobertBrunhage commented Jul 28, 2024

@frankroeder based! Awesome to see and thanks for the clarifications.

Have you had any plans to potentially add in AI completion as well or is that outside the scope of this plugin?

You can close the issue if you want as well as above answered my actual issue (or if you would like me to fill out the issue with more cursor features to have as a reference for the plugin regarding AI features)

@frankroeder
Copy link
Owner

frankroeder commented Jul 28, 2024

I consider completion to be out of scope for this project, as it analyzes your files and tracks the position of your cursor to constantly generate potential completions in the background. This can become very costly, especially for larger projects, when using the usual APIs. Furthermore, I think it is very difficult to implement this well (considering LSP integration, etc.).

With parrot.nvim, I like to focus on inline prompt-based edits and lightweight chats within markdown files that are simply buffers, allowing the user stay in control of the costs and what gets sent. I believe that the custom hooks provide a lot of flexibility, as they can harness the full range of Lua functions for any type of routine, including completions.

For example, I have this experimental feature that generates Git commit messages based on the output of git diff, that I simply trigger inside the commit editor (see here https://github.com/frankroeder/dotfiles/blob/8bf98a5f017ed79dc1b1d6736a73fbbc43df3890/nvim/lua/plugins/parrot.lua#L236)

Feel free to move this to a discussion.

@RobertBrunhage
Copy link
Author

I consider completion to be out of scope for this project, as it analyzes your files and tracks the position of your cursor to constantly generate potential completions in the background. This can become very costly, especially for larger projects, when using the usual APIs. Furthermore, I think it is very difficult to implement this well (considering LSP integration, etc.).

With parrot.nvim, I like to focus on inline prompt-based edits and lightweight chats within markdown files that are simply buffers, allowing the user stay in control of the costs and what gets sent. I believe that the custom hooks provide a lot of flexibility, as they can harness the full range of Lua functions for any type of routine, including completions.

For example, I have this experimental feature that generates Git commit messages based on the output of git diff, that I simply trigger inside the commit editor (see here https://github.com/frankroeder/dotfiles/blob/8bf98a5f017ed79dc1b1d6736a73fbbc43df3890/nvim/lua/plugins/parrot.lua#L236)

Feel free to move this to a discussion.

Understood and makes sense!

Do you want me to move the original issue towards a discussion or were you talking about completion?

Repository owner locked and limited conversation to collaborators Jul 28, 2024
@frankroeder frankroeder converted this issue into discussion #36 Jul 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants