Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf49df19

Browse files
authored
feat(health): require markdown parser and copilotchat query (#1401)
Update health checks to require the markdown treesitter parser andcopilotchat query for chat parsing. Errors are now shown if either ismissing, with instructions for installation. This ensures proper chathighlighting and parsing functionality.Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
1 parent62a91c3 commitf49df19

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

‎lua/CopilotChat/health.lua‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ local function treesitter_parser_available(ft)
3838
returnresandparser~=nil
3939
end
4040

41+
--- Check if a treesitter query is available
42+
---@paramftstring
43+
---@paramquery_namestring
44+
---@returnboolean
45+
localfunctiontreesitter_query_available(ft,query_name)
46+
localquery=vim.treesitter.query.get(ft,query_name)
47+
returnquery~=nil
48+
end
49+
4150
functionM.check()
4251
start('CopilotChat.nvim [core]')
4352

@@ -145,8 +154,16 @@ function M.check()
145154
iftreesitter_parser_available('markdown')then
146155
ok('treesitter[markdown]: installed')
147156
else
148-
warn(
149-
'treesitter[markdown]: missing, optional for better chat highlighting. Install `nvim-treesitter/nvim-treesitter` plugin and run `:TSInstall markdown`.'
157+
error(
158+
'treesitter[markdown]: missing, required for chat parsing. Install `nvim-treesitter/nvim-treesitter` plugin and run `:TSInstall markdown`.'
159+
)
160+
end
161+
162+
iftreesitter_query_available('markdown','copilotchat')then
163+
ok('treesitter[markdown/copilotchat]: found')
164+
else
165+
error(
166+
'treesitter[markdown/copilotchat]: missing, required for chat parsing. See `:h CopilotChat-installation` for instructions.'
150167
)
151168
end
152169

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp