Skip to content

refactor!: use main Tree-sitter branch #1547

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

olimorris
Copy link
Owner

@olimorris olimorris commented Jun 1, 2025

Description

This PR will get the plugin ready for when main becomes the default over on nvim-treesitter.

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated CodeCompanion.has in the init.lua file for my new feature
  • I've added test coverage for this fix/feature
  • I've updated the README and/or relevant docs pages
  • I've run make all to ensure docs are generated, tests pass and my formatting is applied

@olimorris olimorris changed the title fix(chat): add codecompanion ftplugin refactor(chat): update for main tree-sitter branch Jun 1, 2025
@olimorris olimorris requested a review from Copilot June 1, 2025 17:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors CodeCompanion to support the new main branch of nvim‑treesitter and updates the minimum Neovim version from 0.10 to 0.11. Key changes include:

  • Cloning and installing nvim‑treesitter from the main branch.
  • Updating Neovim version checks and error messages across the plugin and health scripts.
  • Adjusting installation steps in minimal init files and CI workflows.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/screenshots/* Updated screenshot files with new outputs reflecting refactored test setups.
scripts/minimal_init.lua Updated Treesitter installation process and registration of markdown.
plugin/codecompanion.lua Updated Neovim version check and error message.
minimal.lua Adjusted lazy plugin dependency for nvim‑treesitter using the main branch.
lua/codecompanion/health.lua Updated health check for Neovim version.
ftplugin/codecompanion.lua Added minimal Treesitter startup routine.
Makefile Updated repository clone command to target the main branch of nvim‑treesitter.
.github/workflows/ci.yml Modified CI steps and added tree‑sitter CLI installation.
.github/ISSUE_TEMPLATE/bug_report.yml Updated Treesitter dependency and installation instructions.

@olimorris
Copy link
Owner Author

Not sure why v0.10.0 tests are failing here

@olimorris olimorris marked this pull request as draft June 1, 2025 21:53
Copy link

cloudflare-workers-and-pages bot commented Jun 7, 2025

Deploying codecompanion with  Cloudflare Pages  Cloudflare Pages

Latest commit: abc67b5
Status: ✅  Deploy successful!
Preview URL: https://46ba9bd9.codecompanion.pages.dev
Branch Preview URL: https://fix-ts-highlighting.codecompanion.pages.dev

View logs

@olimorris olimorris marked this pull request as ready for review June 7, 2025 11:37
@olimorris olimorris changed the title refactor(chat): update for main tree-sitter branch refactor!: update for main tree-sitter branch Jun 7, 2025
@olimorris olimorris changed the title refactor!: update for main tree-sitter branch refactor!: use main Tree-sitter branch Jun 7, 2025
@yavorski
Copy link
Contributor

yavorski commented Jun 7, 2025

Hi! I'm currently waiting for this PR to be merged and using the following workaround in the meantime (NOTE: I'm not using any markdown rendering plugins). Might be helpful for others who have migrated to the tree-sitter main branch as well.

--- treesitter for chat buffers
--- NOTE remove when this PR is merged #1547 
vim.api.nvim_create_autocmd("User", {
  pattern = "CodeCompanionChatCreated",
  group = vim.api.nvim_create_augroup("my-codecompanion-chat", { clear = true }),
  callback = function(event)
    vim.treesitter.start(event.data.bufnr, "markdown")
  end
})

@olimorris
Copy link
Owner Author

Great share @yavorski. I've added this to my previous announcement.

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.

2 participants